Video.js is an open source library for working with video on the web, also known as an HTML video player.
This gem bundles the upstream distribution for use with the Ruby on Rails framework. The version number of the gem always tracks the upstream javascript release and the gem itself doesn't provide any additional methods or helpers. If a need for helpers arises in the future they will be developed as a separate gem with this one as its dependency. Should a gem bug be discovered an additional version identifier will be appended and incremented after the upstream version number.
The gem is developed and tested against Rails 5
videojs-ng and changes made to videojs required for rails are licensed under ISC.
The original videojs code distributed with this gem is licensed under Apache 2 You can find the videojs license file in the vendor directory, changes made to the original code base are as follows:
- added
video-lang.js
to optionally load all existing language files - for consistency with other includes the following renames have been done
videojs-ie8.js
tovideo-ie8.js
video.novtt.js
tovideo-novtt.js
video-js.css
tovideo.css.erb
video-js-cdn.css
tovideo-cdn.css
video-js.css
was changed to load assets via railsasset_path
Add this line to your application's Gemfile:
gem 'videojs-ng'
And then execute:
$ bundle
Or install it yourself as:
$ gem install videojs-ng
include the stylesheet in application.css file:
*= require video
and be sure to include the static assets in config/initializers/assets.rb
Rails.application.config.assets.precompile += %w( VideoJS.eot VideoJS.svg VideoJS.ttf VideoJS.woff )
*= require video-cdn
Add the following directive to your JavaScript manifest file (application.js):
//= require video
By default videojs ships with Apache 2 licensed vtt.js use the novtt include in application.js if you want to avoid it:
//= require video-novtt
If you happen to need ie8 support include (application.js):
//= require video-ie8
Video.js includes localization support to present text in a language other than the default English where appropriate.
You can add the language you need to support by requiring it in your application.js:
//= require video-lang/es
If you want to load all existing supported languages require just video-lang in application.js:
//= require video-lang
Bug reports and pull requests are welcome on GitHub at https://github.com/koparo/videojs-ng.