Giter Club home page Giter Club logo

jquery-videosub's Introduction

VideoSub v0.9.6

Standards compliant video subtitles for HTML5 video tags. Original MooTools implementation by Thomas Sturm, jQuery port by Max Wheeler.

Usage

Dead simple. Call the videoSub() function on any jQuery collection of video elements. This will probably look something like:

$('video').videoSub();

Doing the following will parse the <video> elements you've specified and look for a <track> element. Your HTML should look something like the following:

<video>
  <source src="/path/to/movie.mp4" type="video/mp4">
  <source src="/path/to/movie.ogg" type="video/ogg">
  <track src="/path/to/movie.srt" kind="subtitle" srclang="en-au" label="English">
</video>

If there is a <track> subtitle, it will load and parse the subtitle file (SRT or WebSRT standard) and display the subtitles over the playing video. Should your browser already support <track> tags, VideoSub will feature detect and hide silently.

Options

There are some basic options/defaults you can override for now:

$('video').videoSub({
  containerClass:     'videosub-container',
  barClass:           'videosub-bar',
  useBarDefaultStyle: true
});

By default, some simple styling is applied to the subtitles. You can remove them by setting useBarDefaultStyle to false and do all your styling via CSS instead.

Changelog

0.9.6

  • Deal with line-endings correctly

0.9.5

  • Initial jQuery release

License

VideoSub is released under the MIT license.

jquery-videosub's People

Contributors

makenosound avatar

Watchers

James Cloos avatar Emma Greene avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.