HighDots Forums  

Alternative to Embeds playing WAV in HTML ?

Javascript JavaScript language (comp.lang.javascript)


Discuss Alternative to Embeds playing WAV in HTML ? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Richard Brooks
 
Posts: n/a

Default Alternative to Embeds playing WAV in HTML ? - 06-04-2004 , 02:18 PM






IE5.5

It's probably an oft repeated question but I have some code that used to
work but does not now.

This line in my Javascript code give an error now.

document.embeds[Math.floor(Math.random()*6)].play();

And the following are the six lines of WAV files that used to be played at
random when a timed event happened.

<embed src="ukatc32.wav" width="1" height="1" autostart="false"
hidden="true" />
<embed src="ukatc41.wav" width="1" height="1" autostart="false"
hidden="true" />
<embed src="ukatc42.wav" width="1" height="1" autostart="false"
hidden="true" />
<embed src="ukatc90.wav" width="1" height="1" autostart="false"
hidden="true" />
<embed src="ukatc92.wav" width="1" height="1" autostart="false"
hidden="true" />
<embed src="ukatc93.wav" width="1" height="1" autostart="false"
hidden="true" />

I've been looking for an alternative to 'embed' without the user having
download yet another plugin, so what is the alternative ?

Thanks,

Richard Brooks.



Reply With Quote
  #2  
Old   
Richard Cornford
 
Posts: n/a

Default Re: Alternative to Embeds playing WAV in HTML ? - 06-05-2004 , 05:09 PM






Richard Brooks wrote:
Quote:
IE5.5

It's probably an oft repeated question but I have some code
that used to work but does not now.

This line in my Javascript code give an error now.

document.embeds[Math.floor(Math.random()*6)].play();
snip

if((document.embeds)&&
(document.embeds.length >= 5)){
var em = document.embeds[Math.floor(Math.random()*6)];
em.volume = -1;
em.play();
}

- Seems to work OK on IE 6.

Richard.




Reply With Quote
  #3  
Old   
Richard Brooks
 
Posts: n/a

Default Re: Alternative to Embeds playing WAV in HTML ? - 06-05-2004 , 05:21 PM



Richard Cornford wrote:
Quote:
Richard Brooks wrote:
IE5.5

It's probably an oft repeated question but I have some code
that used to work but does not now.

This line in my Javascript code give an error now.

document.embeds[Math.floor(Math.random()*6)].play();
snip

if((document.embeds)&&
(document.embeds.length >= 5)){
var em = document.embeds[Math.floor(Math.random()*6)];
em.volume = -1;
em.play();
}

- Seems to work OK on IE 6.

Richard.
I hate those strange things that happen! All I did was to archive the stuff
to CDR then some months put it all back without changine version of IE and
set the read only archive bit of the archived files to off just in case then
it throws the error up only in that section.

Thanks for having a look, Richard,


Richard.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.