TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Javascript, AJAX, E4X (http://www.talkphp.com/javascript-ajax-e4x/)
-   -   Sound only works in Internet Explorer (http://www.talkphp.com/javascript-ajax-e4x/4464-sound-only-works-internet-explorer.html)

ebuoe 06-02-2009 02:30 PM

Sound only works in Internet Explorer
 
html4strict Code:
<html>
<head>
<title>Sound Test</title>
<script language="JavaScript" type="text/javascript">


function PlaySound() {
  var sound = document.getElementById("track");
  sound.Play();
}

</script>
</head>
<body>
<h1>Sound Test</h1>
<embed id="track" src="song.mp3" width="0" height="0"
  autostart="false" enablejavascript="true"/>

 
<input type="button" value="Play the Sound"
  onClick="PlaySound()">

 
</body>
</html>

The problem with this code is that it works with IE but it doesn't work with Firefox and opera,even when I used the DoPlay() function it only works
once it does not replay


All times are GMT. The time now is 09:18 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0