I have been trying to figure out the best way to serve music mp3''s from my web server in Rails. If I do mysite.com/audio/mysong.mp3 it seems to play the song, but sometimes a dialog comes up asking if you want to save the file when the user clicks the link. That depends on the browser. I don''t want to do that, I just want the song to play. If I set up a partial template like below. That seems to work on the first load. But when I render the partial a second time with a different song. The first song is still playing and the new song starts playing as well so there are 2 songs playing at the same time. I''ve looked into how to do send_file()/send_data() and so on, not sure on that, but I suspect it may work the same as the other method above ? for that I found this, but I haven''t figured it out: http:// www.ruby-forum.com/topic/61437 Here''s the templat I have that is partialy rendered: <OBJECT width=''300'' height=''42''> <param name=''SRC'' value=<%= "''/public/audio/#{@song}''>" %> <param name=''AUTOPLAY'' VALUE=''true''> <param name=''CONTROLLER'' VALUE=''FALSE''> <EMBED SRC=<%="''/audio/#{@song}'' HIDDEN AUTOSTART=''TRUE'' LOOP=''FALSE'' WIDTH=''0'' HEIGHT=''0'' CONTROLLER=''FALSE'' " %> BGCOLOR=''#FF9900''></EMBED> </OBJECT> While I''m at it, is there any way to have an mp3 keep playing a song when you render a new page ? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 havent tried it, but check out this? http://www.agilewebdevelopment.com/plugins/flash_mp3_image_media_flv_player -- 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 -~----------~----~----~----~------~----~------~--~---
For God''s [and the user''s] sake, _please_ don''t play media on the user''s computer without the user''s explicit request. Remember the mid-late 90''s midi embedded web sites? Oh, the nightmares this is gonna give me. RSL On 2/9/07, surfivor <surfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > > > I have been trying to figure out the best way to serve music mp3''s > from my web server in Rails. > If I do mysite.com/audio/mysong.mp3 it seems to play the song, but > sometimes a dialog comes up asking if you want to save the file when > the user clicks the link. That depends on the browser. > I don''t want to do that, I just want the song to play. > > If I set up a partial template like below. That seems to work on the > first load. But when I render the partial a second time with a > different song. The first song is still playing and the new song > starts playing as well so there are 2 songs playing at the same time. > I''ve looked into how to do send_file()/send_data() and so on, not sure > on that, but I suspect it may work the same as the other method > above ? for that I found this, but I haven''t figured it out: http:// > www.ruby-forum.com/topic/61437 > > Here''s the templat I have that is partialy rendered: > > <OBJECT width=''300'' height=''42''> > <param name=''SRC'' value=<%= "''/public/audio/#{@song}''>" %> > <param name=''AUTOPLAY'' VALUE=''true''> > <param name=''CONTROLLER'' VALUE=''FALSE''> > > <EMBED SRC=<%="''/audio/#{@song}'' HIDDEN AUTOSTART=''TRUE'' LOOP=''FALSE'' > WIDTH=''0'' HEIGHT=''0'' CONTROLLER=''FALSE'' " %> > > BGCOLOR=''#FF9900''></EMBED> > </OBJECT> > > > While I''m at it, is there any way to have an mp3 keep playing a song > when you render a new page ? > > Thanks > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 2/9/07, Russell Norris <sconds-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > For God''s [and the user''s] sake, _please_ don''t play media on the user''s > computer without the user''s explicit request. Remember the mid-late 90''s > midi embedded web sites? Oh, the nightmares this is gonna give me.RSL> > On 2/9/07, surfivor <surfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > I have been trying to figure out the best way to serve music mp3''s > > from my web server in Rails. > > If I do mysite.com/audio/mysong.mp3 it seems to play the song, but > > sometimes a dialog comes up asking if you want to save the file when > > the user clicks the link. That depends on the browser. > > I don''t want to do that, I just want the song to play. > > > > If I set up a partial template like below. That seems to work on the > > first load. But when I render the partial a second time with a > > different song. The first song is still playing and the new song > > starts playing as well so there are 2 songs playing at the same time. > > I''ve looked into how to do send_file()/send_data() and so on, not sure > > on that, but I suspect it may work the same as the other method > > above ? for that I found this, but I haven''t figured it out: http:// > > www.ruby-forum.com/topic/61437 > > > > Here''s the templat I have that is partialy rendered: > > > > <OBJECT width=''300'' height=''42''> > > <param name=''SRC'' value=<%= "''/public/audio/#{@song}''>" %> > > <param name=''AUTOPLAY'' VALUE=''true''> > > <param name=''CONTROLLER'' VALUE=''FALSE''> > > > > <EMBED SRC=<%="''/audio/#{@song}'' HIDDEN AUTOSTART=''TRUE'' LOOP=''FALSE'' > > WIDTH=''0'' HEIGHT=''0'' CONTROLLER=''FALSE'' " %> > > > > BGCOLOR=''#FF9900''></EMBED> > > </OBJECT> > > > > > > While I''m at it, is there any way to have an mp3 keep playing a song > > when you render a new page ? > > > > Thanks > > > > > > > > > >I somewhat agree with Russell on this, however for some sites it can make sense to do this. The issue isn''t specific to Rails, you would use the same techniques as elsewhere. For instance you can have a frame that stays active or you can of course pop a new window to hold this. Either of those methods would allow you to continue playing between page transitions. Both have their own disadvantages (framesets and popup windows blocking). Remember to provide an option for users to silence the sound and note that many users might visit your site at work (where sound isn''t necessarily a desirable thing). It is so frustrating when sites don''t give you the option of turning that off. Blessings, Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy Next Ruby on Rails plus JRuby workshop Feb 22-24 St. Louis, MO http://inspiredhorizons.com/training/rails/index.html Limited seating, register now! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You''ll need to use a player to play the file. Your best bet is one constructed in flash. Then you can give the user controls for muting audio or adjusting volume. M<>< -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of surfivor Sent: Friday, February 09, 2007 1:53 AM To: Ruby on Rails: Talk Subject: [Rails] Playing MP3''s through rails ? I have been trying to figure out the best way to serve music mp3''s from my web server in Rails. If I do mysite.com/audio/mysong.mp3 it seems to play the song, but sometimes a dialog comes up asking if you want to save the file when the user clicks the link. That depends on the browser. I don''t want to do that, I just want the song to play. If I set up a partial template like below. That seems to work on the first load. But when I render the partial a second time with a different song. The first song is still playing and the new song starts playing as well so there are 2 songs playing at the same time. I''ve looked into how to do send_file()/send_data() and so on, not sure on that, but I suspect it may work the same as the other method above ? for that I found this, but I haven''t figured it out: http:// www.ruby-forum.com/topic/61437 Here''s the templat I have that is partialy rendered: <OBJECT width=''300'' height=''42''> <param name=''SRC'' value=<%= "''/public/audio/#{@song}''>" %> <param name=''AUTOPLAY'' VALUE=''true''> <param name=''CONTROLLER'' VALUE=''FALSE''> <EMBED SRC=<%="''/audio/#{@song}'' HIDDEN AUTOSTART=''TRUE'' LOOP=''FALSE'' WIDTH=''0'' HEIGHT=''0'' CONTROLLER=''FALSE'' " %> BGCOLOR=''#FF9900''></EMBED> </OBJECT> While I''m at it, is there any way to have an mp3 keep playing a song when you render a new page ? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 Feb 9, 6:37 am, koloa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> i havent tried it, but check out this? > > http://www.agilewebdevelopment.com/plugins/flash_mp3_image_media_flv_... > > -- > Posted viahttp://www.ruby-forum.com/.Thanks, I''ve played around with this and have had a number of problems with firefox as well as other issues. It does look interesting, but my song will also show up in the html, so it doesn''t prevent anyone from stealing the music any different if I used some other method I''m guessing. At this time I am probably going to try a simpler approach for now I guess. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---