chat notifications sound audio for webpage using js

View previous topic View next topic Go down

chat notifications sound audio for webpage using js

Post by jamied_uk on 18th September 2013, 11:42

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>J~Net Audio test</title>




<script type="text/javascript">
function playSound(filename){  
document.getElementById("sound").innerHTML='<audio autoplay="autoplay"><source src="' + filename + '.mp3" type="audio/mpeg" /><source src="' + filename + '.ogg" type="audio/ogg" /><embed hidden="true" autostart="true" loop="false" src="' + filename +'.mp3" /></audio>';
}
</script>




</head>
<body>

<button onclick="playSound('notify');">Play</button> 
<div id="sound"></div>

</body>
</html>
avatar
jamied_uk
Admin

Posts : 1990
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum