Solved

is it possible to play local music files in browser

Posted on 2006-11-13
2
357 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 invoke it on a web page. 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.: (CODE)

840 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