Solved

is it possible to play local music files in browser

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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)

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now