Hi.. i have a .wav file in my rails public folder. i would like to play that file when i click play link in my application. so i did like below <% @file_path = "#{RAILS_ROOT}" + "/public/Server_exe/#{voicemail.file_path}" %> <%if File.exists?("#{@file_path}")%> <%= link_to image_tag("configure.png",:title => "play"),"/Server_exe/#{voicemail.file_path}" %> <%end%> this code simply opens the file , and the firefox browser asks me whether to open the file in windows media player? if i click yes , browser opens the file and again i should click the play button of windows meadia player... Is there any way to play that file simply when click the play link from my rails application? Thanks for your time. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 6, 2:19 am, Newb Newb <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi.. > > i have a .wav file in my rails public folder. > > i would like to play that file when i click play link in my application. >[snip]> > Is there any way to play that file simply when click the play link from > my rails application? >Your best bet is probably some kind of Flash player, that you feed the URL to in the embed/object tag. At some point in the future, you''ll be able to play the file natively with HTML5, but that''s not yet. Oh, and you''ll want to get some kind of audio compression going - neither your users nor your host are going to like downloading uncompressed .wav files... --Matt Jones -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sent from my iPhone On Feb 6, 2010, at 11:41 AM, Matt Jones <al2o3cr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Feb 6, 2:19 am, Newb Newb <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Hi.. >> >> i have a .wav file in my rails public folder. >> >> i would like to play that file when i click play link in my >> application. >> > [snip] >> >> Is there any way to play that file simply when click the play link >> from >> my rails application? >> > > Your best bet is probably some kind of Flash player, that you feed the > URL to in the embed/object tag. At some point in the future, you''ll be > able to play the file natively with HTML5, but that''s not yet. > > Oh, and you''ll want to get some kind of audio compression going - > neither your users nor your host are going to like downloading > uncompressed .wav files... > > --Matt Jones >If you''re using a browser that supports HTML 5 (i.e. Safari 4, Firefox 3.6, Chrome, or Opera), you can use the <audio> tag today. Also, you might want to covert your .wav file to .mp3. Good luck, -Conrad> -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Most any audio file will play in the browser via an HREF link. Just link to the file. This has nothing to do with rails. It''s basic HTML. You don''t even need html5. Converting to mp3 would be a good idea for compatability and smart downloads. -j Sent from my iPhone On Feb 6, 2010, at 11:41, Matt Jones <al2o3cr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Feb 6, 2:19 am, Newb Newb <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Hi.. >> >> i have a .wav file in my rails public folder. >> >> i would like to play that file when i click play link in my >> application. >> > [snip] >> >> Is there any way to play that file simply when click the play link >> from >> my rails application? >> > > Your best bet is probably some kind of Flash player, that you feed the > URL to in the embed/object tag. At some point in the future, you''ll be > able to play the file natively with HTML5, but that''s not yet. > > Oh, and you''ll want to get some kind of audio compression going - > neither your users nor your host are going to like downloading > uncompressed .wav files... > > --Matt Jones > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
John Adams wrote:> Most any audio file will play in the browser via an HREF link. Just > link to the file. This has nothing to do with rails.Right.> It''s basic HTML.No, it''s not basic HTML. Sure, you can link to an audio file or anything else, but it''s up to the browser to figure out what to do with it -- which puts the OP right back at square one.> You don''t even need html5. > > Converting to mp3 would be a good idea for compatability and smart > downloads.Yup.> > -j > > Sent from my iPhoneBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.