views:

52

answers:

2

Hi,

I would like to request help from experts here but I would like to explain my requirements first. I am building an Ajax Based application that will run on our local intranet network.

  1. Now upon every return of request from my Ajax, I need to play a sound in my client browser.
  2. I want to put a sound file (mp3/wav) in my web server (Tomcat) directory where the application will download and play at the client browser. (I dont want to embed this and will just automatically play)

But I basically have this limitation.

  1. Our target users intranet computers has no access to the outside internet since this is being block by our network team.
  2. Most of the client runs on Windows XP and Flash might not be updated or not being installed.

I know a little jquery but I dont know if what I am thinking is possible and what possible plugin can I use that is basically cross browser. My target browse runs on IE6/IE7/IE8/FF3. Please advise.

+1  A: 

Without flash and without a browser that supports HTML5 <audio> tags, that is going to be tough if not impossible.

My first idea was just to suggest http://www.w3schools.com/html5/tag_audio.asp. Usage

<audio src="/sound/ajax.mp3" id="ajaxdone"/>

// ajax success / readystate == 4
var mysound = $('#ajaxdone')[0];
    mysound.play();

But that is also pretty much impossible in IE6 + 7.

jAndy
@jAndy, Thanks. I figured out also that it would be hard to do this without flash. I manage to talk to my user and have told them that I will just provide a link where they could download the latest flash installer thru inhouse FTP. I think this is more doable. Thank you..
Mark Estrada
A: 

In IE You could use <BGSOUND src= loop="1"> tag - append it and remove it before adding another.

I'm not sure which browsers accept that tag, and it's deprecated.

naugtur