Playing Flash flv files using FlowPlayer

Guys, got a conceptual issue regarding integration of FlowPlayer with
rails views.

Basically, I want to add and view various types of content, such as
stories and video. Adding and saving is successful, however viewing
video (flv) is not working.

The view does a switch based on the contents content type, and if its
video, the view renders a partial that includes the standard html for
using the Flowplayer. (standard:
http://flowplayer.org/documentation/quick+start)

From viewing the logs, it appears once the content page has loaded,
while rendering the partial, the app creates another request to
show.rhtml, and for some Godforsaken reason sets the id to be
Flowplayer.

The following code should make it easier to understand:

======================================================================
I. VIEW (snipped):

<% if @content.contentType.id == 2 %> <%= render :partial => "video" %> <% else %> <%= @content.content %> <% end %>

======================================================================

II. PARTIAL : (hardcoding the flv file for now)

======================================================================

The ‘error’ I get in the log:

Processing ContentController#show (for 127.0.0.1 at 2007-12-23 22:35:20)
[GET]
Session ID: 9ebc624b56c263e48b75386bd18ce457
Parameters: {“format”=>“swf”, “action”=>“show”, “id”=>“FlowPlayer”,
“controller”=>“content”}

Content Load (0.000804) SELECT * FROM contents WHERE (contents.id =
0)

ActiveRecord::RecordNotFound (Couldn’t find Content with ID=FlowPlayer):

======================================================================

As you’ll notice, the app is taking ‘Flowplayer’ to be the conten id,
while a request is generated from the partial. I get the feeling this is
configuration issue I haven’t read about yet. I also experiemented by
creating a SWFObject (from researching) and including the swfobject.js
to run the player, but got a somewhat similar ‘error’

Any information, help or pointers into the right direction will be much
appreciated, and Merry Xmas.

Any takers

Figured it out. In case anyone else has this problem:
Following worked for me in the partial (Note video is hardcoded right
now ):

This will be replaced by the player.

That would’ve been because you were making a request of
“FlowPlayer.swf”, so
Rails assumes you want it in the same controller, and therefore it was
trying to go to contents/FlowPlayer, which would’ve been the show action
for
contents_controller and would’ve been specifying the ID.

You just have to be careful when specifying paths :slight_smile:

On Dec 27, 2007 11:13 AM, Big T. [email protected]
wrote:

Posted via http://www.ruby-forum.com/.


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

Hi, I was worked in a java project where I used flowplayer to stream the
video. Whenever user upload the file I convert that video to FLV format
using ffmpeg tool and store it in the file system. Iam curious to know
what you are following for the following process.

  1. How you convert the video to FLV format
  2. Where you store the file. Is it in file system or database
  3. What version of the flow player you are using
  4. Do you see any problem with the flowplayer.

Do you have any architecture solution or suggestion to create the site
like youtube?

FYI, Iam working in a ROR project now.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs