Playing Flash flv files using FlowPlayer

Big Twinz
Mon, 24 Dec 2007 19:32:33 -0000

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)

<object type="application/x-shockwave-flash"
data="FlowPlayer.swf"
  width="320" height="262" id="FlowPlayer">
  <param name="allowScriptAccess" value="sameDomain"
/>
  <param name="movie"
value="/public/player/FlowPlayer.swf" />




  <param name="flashvars" value="config={videoFile:
''/public/video/sample.flv''}" />


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