Chrome/Webkit audio tag bug?

Posted by Ronald on Stack Overflow See other posts from Stack Overflow or by Ronald
Published on 2010-03-11T04:46:54Z Indexed on 2010/03/11 5:13 UTC
Read the original article Hit count: 237

Filed under:
|
|

I'm trying to get HTML5's audio tag to work in Chrome. The following code works flawlessly in Firefox, any ideas why it isn't working in Webkit?

<html>
  <head>
    <script type="text/javascript">
    function init(){
     audio = new Audio("chat.ogg");
     audio.play(); 
    }
    </script>
</head>
<body onload="init()">
</body>

I should also note that I tried this with an mp3 as well. Regardless of what format, whenever .play() is called on audio, Chrome responds with "undefined".

© Stack Overflow or respective owner

Related posts about html5

Related posts about audio