[Javascript] sounds

tedd tedd at sperling.com
Tue Jun 20 22:05:59 CDT 2006


>You do understand what software is running your script when a user with
>Safari hits the webpage in question?
>
>John Warner
>

Is this a test?

I would guess that the software running the script is the browser that has the sound routines built in, but I could be wrong.

But, if I'm right, then how can js detect if the browser has sound capabilities?

For example, this is what js I have now:

<script type="text/javascript">
<!--
var NSsound = navigator.plugins && navigator.plugins["LiveAudio"];
var IEsound = navigator.plugins && document.all;
var audioEnabled = NSsound || IEsound;
if (!audioEnabled)
alert("Your browser cannot play sound files.");
if (audioEnabled)
document.write("Let's take a look at the <CODE><FONT COLOR='#0000cc'>&lt;EMBED&gt;</FONT></CODE> tag in action (requires a sound-enabled browser):</P><EMBED SRC='xfiles.mid' AUTOSTART='false'HEIGHT='60' WIDTH='144'></P>");
else document.write("Your browser cannot play sound files.");
-->
</script>

However, in a sock Safari the sound files play if I don't rely on audioEnabled -- it don't work for detecting Safari and probably other browsers.

So, I would like to know if there is an "approved" way of doing this, is there?

tedd

--- previously said (top posting)


> > -----Original Message-----
>> From: javascript-bounces at LaTech.edu
>> [mailto:javascript-bounces at LaTech.edu] On Behalf Of tedd
>> Sent: Tuesday, June 20, 2006 7:16 PM
>> To: javascript at LaTech.edu
>> Subject: [Javascript] sounds
>>
>>
>> Hi gang:
>>
>> I've Googled for javascript and sound files, but everything
>> I've seen looks dated and every script I've tried doesn't
>> recognize Safari as a sound-capable browser.
>>
>> Anyone have a reference for the most current script to detect
>> sound-capable browsers (including Safari) and be able to play
>> ".au" sound files?
>>
>> Many thanks in advance.
>>
>> tedd
>
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript


-- 
------------------------------------------------------------------------------------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list