Hello list, The website I''m developing has many FLV-encoded videos as it''s main products. Currently I''m just throwing the FLVs in a public folder, however, the client would like more control over the serving of these files. I don''t want the webserver to serve it raw, I''d like a Rails controller''s action to serve it, something like /videos/render/1. This action would in turn load the FLV, process any logic (such as checking if the user has access to it etc) and only then serve it to the client. However, I have no clue on how I could possibly accomplish this. Any help would be very much appreciated! Thanks, Marcelo. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On thing that may not have been clear, the example I gave of /videos/render/1 would not render html with a code to embed a FLV, instead, it would send the actual FLV file and then the other viewer pages would use this URL to access the video files and not the file name as it would have been the case if the files were served via the webserver (/videos/file.flv) - the point here is that I need to process logic before serving the file something that I would like to integrate into my rails app (such as checking if the logged user has permissions to get this file!). Thanks! On 11/1/07, Marcelo de Moraes Serpa <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello list, > > The website I''m developing has many FLV-encoded videos as it''s main > products. Currently I''m just throwing the FLVs in a public folder, however, > the client would like more control over the serving of these files. I don''t > want the webserver to serve it raw, I''d like a Rails controller''s action to > serve it, something like /videos/render/1. This action would in turn load > the FLV, process any logic (such as checking if the user has access to it > etc) and only then serve it to the client. However, I have no clue on how I > could possibly accomplish this. Any help would be very much appreciated! > > Thanks, > > Marcelo. >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey, I don''t know if you''ve seen this, but it might be informative: http://blog.snowonrails.com/articles/2007/05/31/how-to-build-a-mini-youtube-using-activemessaging-plugin-and-amazon-s3 On Nov 1, 2007, at 1:56 PM, Marcelo de Moraes Serpa wrote:> On thing that may not have been clear, the example I gave of /videos/ > render/1 would not render html with a code to embed a FLV, instead, > it would send the actual FLV file and then the other viewer pages > would use this URL to access the video files and not the file name > as it would have been the case if the files were served via the > webserver (/videos/file.flv) - the point here is that I need to > process logic before serving the file something that I would like to > integrate into my rails app (such as checking if the logged user has > permissions to get this file!). > > Thanks! > > On 11/1/07, Marcelo de Moraes Serpa <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hello list, > > The website I''m developing has many FLV-encoded videos as it''s main > products. Currently I''m just throwing the FLVs in a public folder, > however, the client would like more control over the serving of > these files. I don''t want the webserver to serve it raw, I''d like a > Rails controller''s action to serve it, something like /videos/render/ > 1. This action would in turn load the FLV, process any logic (such > as checking if the user has access to it etc) and only then serve it > to the client. However, I have no clue on how I could possibly > accomplish this. Any help would be very much appreciated! > > Thanks, > > Marcelo. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Matthew, thanks for the reply - yes, I''ve seen this and it is a very good tutorial, however it does not show how to do what I want - serve FLV through Ruby/Rails. Take for example the serving of images through a script - instead of outputing HTML, you output binary data and tell the client (browser) that it is a image/jpg (I did it many times in PHP) - What I would like to know is how could I do this in Ruby/Rails. Marcelo. On 11/1/07, Matthew Swasey <matt.swasey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hey, I don''t know if you''ve seen this, but it might be informative: > > http://blog.snowonrails.com/articles/2007/05/31/how-to-build-a-mini-youtube-using-activemessaging-plugin-and-amazon-s3 > > On Nov 1, 2007, at 1:56 PM, Marcelo de Moraes Serpa wrote: > > On thing that may not have been clear, the example I gave of > /videos/render/1 would not render html with a code to embed a FLV, instead, > it would send the actual FLV file and then the other viewer pages would use > this URL to access the video files and not the file name as it would have > been the case if the files were served via the webserver (/videos/file.flv) > - the point here is that I need to process logic before serving the file > something that I would like to integrate into my rails app (such as checking > if the logged user has permissions to get this file!). > > Thanks! > > On 11/1/07, Marcelo de Moraes Serpa <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello list, > > > > The website I''m developing has many FLV-encoded videos as it''s main > > products. Currently I''m just throwing the FLVs in a public folder, however, > > the client would like more control over the serving of these files. I don''t > > want the webserver to serve it raw, I''d like a Rails controller''s action to > > serve it, something like /videos/render/1. This action would in turn load > > the FLV, process any logic (such as checking if the user has access to it > > etc) and only then serve it to the client. However, I have no clue on how I > > could possibly accomplish this. Any help would be very much appreciated! > > > > Thanks, > > > > Marcelo. > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marcelo de Moraes Serpa wrote:> Hi Matthew, thanks for the reply - yes, I''ve seen this and it is a > very good tutorial, however it does not show how to do what I want - > serve FLV through Ruby/Rails. Take for example the serving of images > through a script - instead of outputing HTML, you output binary data > and tell the client (browser) that it is a image/jpg (I did it many > times in PHP) - What I would like to know is how could I do this in > Ruby/Rails.Look for the send_file method on api.rubyonrail.org. In most cases involving large files (like FLV) it won''t be enough though. You most likely will get huge Ruby processes lying around because of buffering. Look for secure download plugins for mongrel or your favorite HTTP server to solve this problem. Lionel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Marcelo,> Hi Matthew, thanks for the reply - yes, I''ve seen this and it is a very > good > tutorial, however it does not show how to do what I want - serve FLV > through > Ruby/Rails. Take for example the serving of images through a script - > instead of outputing HTML, you output binary data and tell the client > (browser) that it is a image/jpg (I did it many times in PHP) - What I > would > like to know is how could I do this in Ruby/Rails.Check out WhooTube [1]. It does what you want! [1] http://www.nedforce.com/2007/6/11/whootube-ruby-on-rails-video-streaming-open-sourced -- Roderick van Domburg http://www.nedforce.com -- 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 -~----------~----~----~----~------~----~------~--~---
Hi Roderick, thanks a bunch for this! On 11/2/07, Roderick van Domburg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi Marcelo, > > > Hi Matthew, thanks for the reply - yes, I''ve seen this and it is a very > > good > > tutorial, however it does not show how to do what I want - serve FLV > > through > > Ruby/Rails. Take for example the serving of images through a script - > > instead of outputing HTML, you output binary data and tell the client > > (browser) that it is a image/jpg (I did it many times in PHP) - What I > > would > > like to know is how could I do this in Ruby/Rails. > > Check out WhooTube [1]. It does what you want! > > [1] > > http://www.nedforce.com/2007/6/11/whootube-ruby-on-rails-video-streaming-open-sourced > > -- > Roderick van Domburg > http://www.nedforce.com > -- > 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 -~----------~----~----~----~------~----~------~--~---
I think what you''re looking for is X-Sendfile. There''s a Rails plugin at http://john.guen.in/rdoc/x_send_file/ and it works with an Apache module that you can find at http://john.guen.in/rdoc/x_send_file/. This allows Rails to handle the decision to serve the file, but then let the file itself be statically served. You definitely don''t want to serve video files through send_file. Michael www.buildingwebapps.com On Nov 1, 6:38 pm, Lionel Bouton <lionel-subscript...-WTamNBQcZIx7tPAFqOLdPg@public.gmane.org> wrote:> Marcelo de Moraes Serpa wrote: > > > Hi Matthew, thanks for the reply - yes, I''ve seen this and it is a > > very good tutorial, however it does not show how to do what I want - > > serve FLV through Ruby/Rails. Take for example the serving of images > > through a script - instead of outputing HTML, you output binary data > > and tell the client (browser) that it is a image/jpg (I did it many > > times in PHP) - What I would like to know is how could I do this in > > Ruby/Rails. > > Look for the send_file method on api.rubyonrail.org. In most cases > involving large files (like FLV) it won''t be enough though. You most > likely will get huge Ruby processes lying around because of buffering. > Look for secure download plugins for mongrel or your favorite HTTP > server to solve this problem. > > Lionel--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---