Solved

is it possible to play local music files in browser

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Timer on div 5 22
Problem evaluating javascript equality expression 8 17
Html split(text) Part2 6 20
javascript works in Chrome, but none of the other browsers 14 27
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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)

713 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