public
Rubygem
Description: Rails plugin that easily allows you to show video streams on your site.
Homepage: http://blog.matt-darby.com/category/code-stuff/acts_as_video_fu/
Clone URL: git://github.com/mdarby/acts_as_video_fu.git
name age message
file MIT-LICENSE Loading commit data...
file README.textile
file Rakefile Sun Oct 05 07:35:16 -0700 2008 Initial commit [mdarby]
file acts_as_video_fu.gemspec Sun Mar 15 08:11:12 -0700 2009 Updated YouTube RegExp to allow "feature" param [mdarby]
file init.rb Sun Dec 14 12:10:36 -0800 2008 Gem-ified and updated README [mdarby]
file install.rb
directory lib/ Sun Mar 15 08:11:12 -0700 2009 Updated YouTube RegExp to allow "feature" param [mdarby]
directory rails/ Sun Dec 14 12:10:36 -0800 2008 Gem-ified and updated README [mdarby]
directory tasks/
directory test/
file uninstall.rb

ActsAsVideoFu

A Rails plugin that easily allows you to show video streams on your site.
Currently, YouTube and Vimeo streams are supported.

Note that #video_url is expected to be in these formats:

YouTube: http://www.youtube.com/watch?v=gEILFf2XSrM 
Vimeo: http://www.vimeo.com/726135

Installation

  1. Install the gem
    sudo gem install mdarby-acts_as_video_fu
  1. Require the gem in your config/environment.rb file
    config.gem ‘mdarby-acts_as_video_fu’, :lib => ‘acts_as_video_fu’

Example

  1. Generate a resource that includes the title:string and video_url:string attributes
    ./script/generate scaffold Video title:string video_url:string
  1. Add ‘acts_as_video_fu’ to your model

    class Video < ActiveRecord::Base
    acts_as_video_fu
    end
  1. Show the video’s thumbnail in any view you might like
    <%= image_tag thumbnail_url(video) %>
  1. Add the ‘display_video’ helper to show the full-sized video in any view you might like
    <%= display_video(@video) %>

Copyright © 2008 Matt Darby, released under the MIT license