views:

79

answers:

1

Hi,

I need to embed flv, mp4 and possibily other videos in a rails 2.3.5 application.

I'm having quite a lot of problems making the videos show up in Safari 5 and Firefox 3.5.

Is there an easy way to achieve a cross-browser video player and embed it in a rails app?

I tried swfobject 1.5 and 2.2 with jw_player and also flowplayer but with no result.

+2  A: 

Hello,

I use in rails 2.3.5 application JW Player with rails plugin jw-playr-hlpr.

It easy to use:

  1. install plugin
  2. run rake jw_player:install
  3. insert
     <%= javascript_include_tag 'swfobject' %> 
    into your layout
  4. after that you can use following helper:
    <%= player({:file => path_to_flv}, {:width => 680, :height => 420}) %>

I tested it in Firefox 3.6.8, Opera, Chrome 5 and Safari 5 and it's working well...

vhyza
That was the first solution I tried but with no luck. The player shows but an error symbol with no message is returned inside the player.
tommasop
What are you using for video conversion? I use ffmpeg.Example:ffmpeg -i #{ data.path } -b 600k -acodec libfaac -ar 44100 -ab 96k -ac 2 -aspect #{self.aspect} -threads #{CPUS || 1} -s #{self.video_dimensions} -vcodec libx264 -vpre hq -r 25 -qscale 2 -f flv -y #{ self.path_flv }
vhyza
I would like to make people upload only flv and mp4 and just display it. I can arrange conversion very easily because I use ffmpeg to get a preview image from the video but I'm scared that it would consume too much resources.
tommasop
This version of the plugin works for me. http://github.com/fzero/jw-playr-hlpr
tommasop