Solved

is it possible to play local music files in browser

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)

760 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

21 Experts available now in Live!

Get 1:1 Help Now