Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

is it possible to play local music files in browser

Posted on 2006-11-13
2
Medium Priority
?
367 Views
Last Modified: 2013-11-18
Is it possible to play mp3 files stored on the clients machine in their browser?   This is assuming they willingly give the location of the file on there local machine and want to do this.  It worked for me in an old version of IE but doesn't seem to play in more current browsers FF & IE7 I'm not sure if I have to do anything special for this or if it's just not allowed.  If it can't be done with JavaScript could this be done with say a Java Applet?
0
Comment
Question by:ICPooreman
2 Comments
 
LVL 6

Expert Comment

by:system_down
ID: 17933205

Hi,
forget javascript, try with activex or with an applet.
0
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 1500 total points
ID: 17933210
Hi,

look at this...
http://www.microsoft.com/windows/ie/ie6/using/howto/customizing/mediabar.mspx

<script>
function playSound(soundname) {
 var sound = eval("document." + soundname);

 // make an effort to stop and rewind any playback
 // already in progress so that the sound starts over.
 // Otherwise this call has no effect when the sound
 // is already in progress. You can remove these lines
 // if you don't like this behavior.
 try {
  sound.Stop();
  sound.Rewind();
 } catch (e) {
  // A player that doesn't support
  // Stop and Rewind
 }

 try {
  // For RealPlayer-enabled browsers.
  // Some versions of RealPlayer do not
  // offer a Play() function and will
  // fail to play sound if we try to
  // call Play().
  sound.DoPlay();
 } catch (e) {
  // If DoPlay doesn't work, call Play.
  // This works for all other audio
  // plug-ins.
  sound.Play();
 }
}
</script>
http://www.javascripter.net/faq/sound/play.htm
http://www.jsmadeeasy.com/javascripts/Audio/list_test.asp
http://www.javascriptkit.com/script/script2/soundlink.shtml

R.K
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question