Skip to content

Commit

Permalink
Merge pull request seanbehan#4 from grzlus/master
Browse files Browse the repository at this point in the history
Update to 4.1.0
  • Loading branch information
seanbehan committed Jul 3, 2013
2 parents ba49320 + 514570f commit 742b707
Show file tree
Hide file tree
Showing 16 changed files with 6,868 additions and 2,349 deletions.
30 changes: 12 additions & 18 deletions app/views/videojs_rails/_videojs_rails.html.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<!-- Begin VideoJS -->
<div class="video-js-box">
<!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
<video id="<%=@options[:id]%>" class="<%= @options[:classes] %> video-js" width="<%=@options[:width]%>" height="<%=@options[:height]%>" controls="controls" preload="auto">
<video id="<%=@options[:id]%>" class="<%= @options[:classes] %> video-js vjs-default-skin" controls preload="auto" width="<%=@options[:width]%>" height="<%=@options[:height]%>" poster="<%= @options[:poster] %>" data-setup="{}">
<% if @options[:sources] %>
<%- @options[:sources].each do |type, source| %>
<source src="<%= source %>" type='video/<%= type %>' />
<%- end %>
<%- end %>

<source src="<%=@options[:source]%>" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />

<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
<object id="flash_fallback_1" class="vjs-flash-fallback" width="<%=@options[:width]%>" height="<%=@options[:height]%>" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="true" />
<param name="flashvars" value='config={"playlist":["<%=@options[:poster]%>", {"url": "<%=@options[:source]%>","autoPlay":false,"autoBuffering":true}]}' />

<!-- Image Fallback. Typically the same as the poster image. -->
<img src="<%=@options[:poster]%>" width="<%=@options[:width]%>" height="<%=@options[:height]%>" alt="" title="" />
</object>
<%# TODO: Add some function to change ISO country code to name %>
<% if @options[:captions] %>
<%- @options[:captions].each do |lang, caption| %>
<track kind="captions" src="<%= caption %>" srclang="<%= lang %>" label="<%= lang %>"></track>
<%- end %>
<%- end %>
</video>

<!-- Download links provided for devices that can't play video in the browser. -->
<p class="vjs-no-video"><a href="<%=@options[:source]%>">download</a> </p>
</div>
<!-- End VideoJS -->
2 changes: 1 addition & 1 deletion lib/videojs_rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VideojsRails
VERSION = "0.0.1"
VERSION = "4.1.0"
end
32 changes: 18 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
# VideoJS for Rails 3.1 Asset Pipeline
# VideoJS for Asset Pipeline

## Installation

Add to your Gemfile

```ruby

gem 'videojs_rails'

```

And run bundle to install the library.

```ruby

bundle

```

Add the resources to your application.js file

```coffeescript

# app/assets/javascripts/application.js
//= require videojs

//= require video
```

You can optionally include skins by requiring in app/assets/stylesheets/application.css
And that resource to application.css file

```sass
/*
*= require_self
*= require videojs
*= require skins/hu.css
*/
```

_currently not working_
_currently skins are not implemented (after migrate to 4.1 version)_

And to production.rb add this line

```ruby
config.assets.precompile += %w( video-js.swf vjs.eot vjs.svg vjs.ttf vjs.woff )
```

## Usage

```erb
<%= videojs_rails sources: { mp4: "http://domain.com/path/to/video.mp4", webm: "http://another.com/path/to/video.webm" }, width:"400" %>
```

## Captions

<%= videojs_rails source: "http://domain.com/path/to/video.mp4", width:"400px" %>
This is currently experimental function.

```erb
<%= videojs_rails sources: { mp4: "http://domain.com/path/to/video.mp4" }, width:"400", captions: { en: "http://domain.com/path/to/captions.vvt" } %>
```


## Resources
http://videojs.com/
http://videojs.com/#getting-started
Expand Down
Binary file added vendor/assets/flash/video-js.swf
Binary file not shown.
Binary file added vendor/assets/fonts/vjs.eot
Binary file not shown.
40 changes: 40 additions & 0 deletions vendor/assets/fonts/vjs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vendor/assets/fonts/vjs.ttf
Binary file not shown.
Binary file added vendor/assets/fonts/vjs.woff
Binary file not shown.
Binary file added vendor/assets/images/video-js.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 742b707

Please sign in to comment.