Bonjour,
Je cherche a lancer une musique de fond via javascript en utilisant new Audio() mais j'ai une erreur sous safari :
TypeError: 'undefined' is not a constructor (evaluating 'new Audio("test.mp3")')
il semblerais que new audio semble ne pas etre reconnu sous safari.
voici mon code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<script type="text/javascript">
function test()
{
var sound = new Audio("test.mp3");
sound.play();
}
</script>
</head>
<body onLoad="test()">
</body>
</html> |
Merci d'avance
Partager