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): <div id ="content-content"> <% if @content.contentType.id == 2 %> <%= render :partial => "video" %> <% else %> <%= @content.content %> <% end %> </div> ===================================================================== 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="quality" value="high" /> <param name="scale" value="noScale" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="config={videoFile: ''/public/video/sample.flv''}" /> </object> ===================================================================== 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Any takers -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Figured it out. In case anyone else has this problem: Following worked for me in the partial (Note video is hardcoded right now ): <script type="text/javascript" src="/player/html/swfobject.js"></script> <div id="flowplayerholder"> This will be replaced by the player. </div> <script type="text/javascript"> // <![CDATA[ var fo = new SWFObject("/player/FlowPlayer.swf", "FlowPlayer", "468", "350", "7", "#ffffff", true); // need this next line for local testing, it''s optional if your swf is on the same domain as your html page fo.addParam("allowScriptAccess", "always"); fo.addParam("loop", false); fo.addVariable("config", "{ playList: [ {overlayId: ''play'' }, { url: ''/video/sample.flv'' } ], initialScale: ''scale'' }"); fo.write("flowplayerholder"); // ]]> </script> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 :) On Dec 27, 2007 11:13 AM, Big Twinz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Figured it out. In case anyone else has this problem: > Following worked for me in the partial (Note video is hardcoded right > now ): > > > <script type="text/javascript" src="/player/html/swfobject.js"></script> > <div id="flowplayerholder"> > This will be replaced by the player. > </div> > <script type="text/javascript"> > // <![CDATA[ > var fo = new SWFObject("/player/FlowPlayer.swf", "FlowPlayer", > "468", "350", "7", "#ffffff", true); > // need this next line for local testing, it''s optional if your swf is > on the same domain as your html page > fo.addParam("allowScriptAccess", "always"); > fo.addParam("loop", false); > fo.addVariable("config", "{ playList: [ {overlayId: ''play'' }, { url: > ''/video/sample.flv'' } ], initialScale: ''scale'' }"); > fo.write("flowplayerholder"); > // ]]> > </script> > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ayyanar from Aspire Systems
2007-Dec-27 06:30 UTC
Re: Playing Flash flv files using FlowPlayer
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---