Video subtitles are an accessibility problem. In many countries websites are required by law to offer reasonable accessibility features, and one would hope that video subtitles are considered "reasonable" in 2012.
While there is a W3C and WHATWG spec in the works, none of the major browsers fully supports the new track elements and the brand new WebVTT subtitle standard. And older browsers may support video tags, but have no built in way to show subtitles over HTM5 video at all.
VideoSub is an easy solution for this problem and will get out of the way if the track element references a subtitle file in the new WebVTT standard.
VideoSub - a standards compliant way to add video subtitles to HTML5 video tags.
Features:
- Standards compliant - follows the draft specification for Media Text Associations. Just add <track> tags to your videos
- No coding required - just include VideoSub on a page with video tags
- No outside dependencies to other frameworks
- Handles multiple videos on a single page
- Works with common .SRT subtitle files (WebVTT support for older browsers is planned as soon as there are standards compliant tools to create WebVTT files)
- It will stay out of the way if the track tag references a subtitle file in the new WebVTT standard
- Supports seeking in the video
Lets get the show on the way:
You may also be interested in some of my other articles around HTML5, CSS3 and JavaScript.
Example
Here is a simple example of a HTML5 video tag with a <track> tag. VideoSub finds the video on pageload and loads the subtitle file which will then automatically be displayed when the video is played. Also check out what happens when you move the playhead with the mouse.
Code
Here is the code for the web developer who just wants this to work:
That's all you need! There are NO outside dependencies.
Ports: There is a jQuery port of the older version 0.9.6 on GitHub - the port is called jquery-videosub by Max Wheeler.
Limitations for version 0.9.9:
- Only works with SRT format subtitles - in the future VideoSub will provide basic WebVTT support for older browsers
- Only supports a single <track> tag, ignores any further tracks after the first one in a video tag
- Ignores "kind" property of tracks
Download
VideoSub is licensed under MIT - copyright Thomas Sturm. The contained Ender framework is licensed under MIT - copyright 2012 Dustin Diaz & Jacob Thornton http://ender.no.de/
Or Download VideoSub 0.9.9 Here
Version History:
v0.9 (June 24, 2010): Initial public version of VideoSub
v0.9.5 (June 26, 2010): Added font scaling for videos that are more than 400 pixels wide
v0.9.6 (February 10th, 2011): Updated VideoSub to work with MooTools 1.3
v0.9.9 (August 23rd, 2012): Comes with integrated Ender framework, no outside dependencies
Discussion
Sorry, but we have to trick the spambots... How much is 2+1? *:
URL:
JavaScript:
HTML: