How to play video in ruby on rails

hey everyone i want to add a video and play it using ruby on rails .
how can i do it. can anyone help me plzz…

Thanks in advance

hr> hey everyone i want to add a video and play it using ruby on rails .
hr> how can i do it. can anyone help me plzz…

hr> Thanks in advance

After struggling with this for several days, I have finally been able to
get some videos to play in Rails 3.1.2. There may be other ways of
playing videos and if there are I’d sure like to hear about

Here is some preliminary documentation. I’m gonna write up more when I
get all the kinks out.

The following instructions are for Rails 3.1.2

  1. Download from here:
    File: README — Documentation for jw_player_helper (0.0.1)

  2. Add
    gem ‘jw_player_helper’
    to your Gemfile

  3. Do
    bundle install
    bundle install --deployment
    depending on your needs.

  4. Assuming that you are using sprockets (which seems to be the
    recommended default), make sure that swfobject.js is accessible from
    your assets.

    You can check if swfobject.js is accessible by displaying

    Rails.application.config.assets.paths is an array of fully qualified
    directory names where assets can be found. Make sure that swfobject.js
    is in one of the directories and not in a subdirectory
    of one of these directories.

  5. Place your video(s) in a directory underneath public. I chose a
    directory named “videos”.

    = video_player( {:file => ‘videos/my_video.flv’}, {:width => ‘100%’}

Let me know if you get videos to work and if this sketch of
documentation needs to be beefed up.

Oh, this sketch is due to a frustrating 5 days of trying to get videos
to play on 3.1.2. I hope it takes you a lot less time.


According to my knowledge you can play the video url using a iframe or
using Y_tube gem…

i am using 2.3.8 rails and ruby 1.8.7 does it work in this version. is
mandatory to have rails 3

Sorry to be harsh, but if you don’t know how to code to play videos,
you probably ought to forget about RoR for a bit and start with
learning front-end coding and playback mechanisms. Once you have some
solid tools built up, you can then bring it back into RoR and use Ruby
to draw your video players and source files dynamically.

There are plenty of good places to start, depending on your needs:
code · Video for Everybody!

or simply - embedding videos.

You need to know the difference between front-end and back-end tools
(client side and server side). Realizing that RoR will ultimately
deliver front-end code to the user in some form or another


You can play easy with flash players. So isn’t a ruby task, you can add
view layer as html/js code.


Felipe Fontoura
Eng. de Computao

2011/12/28 honey ruby [email protected]

Some times it’s nice to know if there is a defacto standard - the
current HTML5 generation of players are still pretty buggy.

The best I’ve used is mediaelementjs, there is a rails gem here:

This playing a video is a new one for me so i am learning it. if u don’t
know how play a video it does not mean you don’t know ROR . New things
to learned only by researching and in that process only i posted it.

Hi Ralph S.

I followed your steps for using jw_player_helper. I got the jw player on
my view but somehow it does not play any video. I have put up the video
under public/videos .When click on play, it shows no-access or file not
found at videos/3.mp4 . What I could be missing?
I am working on Rails 3.2.11