Chrome/Webkit audio tag bug?

前端 未结 3 766
说谎
说谎 2021-02-08 12:47

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?


         


        
相关标签:
3条回答
  • 2021-02-08 13:18

    Are you using the release version of Chrome? With the current dev build on Linux[1], I get the same behavior as FF 3.7 alpha (well, once I unblocked it with noscript) and SeaMonkey 2.0; that is, the Ogg file plays, although not even the default controls appear. If it is a bug in Chrome or Webkit, it is apparently fixed for the next version.

    [1] Chrome: 5.0.342.1 (Official Build 40461) dev, Webkit: 533.2

    0 讨论(0)
  • 2021-02-08 13:21

    Try to host your audio file somewhere and try this:

    audio = new Audio('http://www.yourhosting.com/chat.ogg');
    audio.play();
    
    0 讨论(0)
  • 2021-02-08 13:23

    Bug in Chrome, possibly Webkit as well: http://code.google.com/p/chromium/issues/detail?id=25972

    Short audio files won't play.

    0 讨论(0)
提交回复
热议问题