PDA

View Full Version : embedding .wav files



Jessica
Jul 1st, 2002, 03:06 PM
I usually find sound annoying, but presently I need to be able to allow visitors to a particular site listen to clips from a CD they may or may not be purchasing.
The page I've set up to test is:

http://195.184.240.253/JESSICATEST.cfm?rn=18841

My code is:
<input type="button" value="play" onClick="document.vid.DoPlay()" name="buttonstart">
<input type="button" value="stop" onClick="document.vid.DoStop()" name="buttonstop">
<embed src="igocrazy.wav"
align="baseline" border="0" hidden="true" controls="smallconsole"
autostart="true" loop="true" name="vid">
<br>
<font size="1" face="Verdana">Paul Davis - I Go Crazy</font>

I keep getting an error, can you tell me what I've done wrong?

ACJavascript
Jul 1st, 2002, 11:15 PM
you could try something like this

-----

<script language="javascript">

function playSound(){

document.cdplayer.play()

}
function stopSound(){

document.cdplayer.stop()

}
</script>

--------------

<embed src="Wav.wav" name="cdplayer" MASTERSOUND>


Hope this helps:D

whackaxe
Jul 2nd, 2002, 10:21 AM
what does the MASTERSOUND in the embed tag mean?

Jessica
Jul 2nd, 2002, 10:38 AM
I wanted to know what's wrong w/ my code though - I'm sure yours would work (it did) but I really didn't want the entire player visible.
If anybody can help I'd really appreciate it.

hp_maniac_50
Jul 2nd, 2002, 06:44 PM
<html>
<head>
</head>
<body>
<input type="button" value="play" onClick="document.vid.DoPlay()" name="buttonstart">
<input type="button" value="stop" onClick="document.vid.DoStop()" name="buttonstop">
<embed src=" "
align="baseline" border="0" hidden="true" controls="none"
autostart="true" loop="true" name="vid">
<br>
<font size="1" face="Verdana">Paul Davis - I Go Crazy</font>
</body>
</html>

Take off the "DoPlay" and "DoStop" on the input onClick on both buttons and put "Play" and "Stop". It worked for me so I hope it works for you too. Oh yeah, I don't know if this affected anything but change the value of controls on the embed to none instead of smallconsole. Good Luck!

ACJavascript
Jul 2nd, 2002, 09:20 PM
MASTERSOUND. Well what it does is allows that emebed to have control. So if you did not name the embed like name="jukebox" then it will play the MASTERSOUND. Its kind of a backup if something was to go wrong. :D