Jump to content

Play sound if my ajax response = 1 ?


lynxus

Recommended Posts

Hi Guys,

 

I currently have a method of getting a users attention by injecting a flash file in an ajax response and placing it in a div.

However, Newer security measures from browsers mean that the file doesnt play on certain versions of certain browsers..

 

Anyway.

Is there another method of achieving this?

I see that facebook play a sound when a new message comes in, so it must be possible? ( Html5? )

 

Essentially I need a website (javascript?) to query playsound.php If playsound.php responds with "1" ( ie it just replies with an output of 1 ) then id like it to play a sound.

 

I would then use a JS timer to run the ajax query every so often to check if it needs to play a sound.

 

Does anyone have any ideas on how I can do this? As it appears my original method of using ajax to fill a div with a flash element is fastly becoming outdated.

 

Thanks in advance

Graham

Link to comment
https://forums.phpfreaks.com/topic/257446-play-sound-if-my-ajax-response-1/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.