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

Hello!

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

[]'s

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

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
it.

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: http://rubydoc.info/gems/jw_player_helper/0.0.1/file/README.markdown#

2) Add
     gem 'jw_player_helper'
   to your Gemfile

3) Do
     bundle install
   or
     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.

   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.

Hey,

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 it 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:
http://camendesign.com/code/video_for_everybody
http://sandbox.thewikies.com/vfe-generator/
http://flowplayer.org
http://videojs.com

or simply youtube.com - 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

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:
https://github.com/tobsch/mediaelement_rails

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 has to learned only by researching and in that process only i posted it.

Hi Ralph Shnelvar

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

Make sure that swfobject.js is in one of the directories and not in a
subdirectory of one of these directories.
http://www.hqew.net