In website http://www.benjoffe.com/code/demos/canvascape/, an audio object is created with following code:
var audio = window.Audio && new Audio("shoot.wav");
And when "audio.play();" is executed, it won't play with WebKit based browser, like Chromium, Safari.
The reason is probably that this Audio object is not attached to the DOM tree.
An audio element should play whether or not it is in the DOM, and I hear the shoot sound when I press the "B" key on both OSX and XP. Can you play the sound file (http://www.benjoffe.com/code/demos/canvascape/shoot.wav) when you load it directly?
Yeah, I can hear the shoot sound when using the direct link, and I can hear the shoot sound in FireFox when press "B" key too.
> Yeah, I can hear the shoot sound when using the direct link
Does the sound play when you load the file directly in Safari? How about in the current WebKit nightly?
If not, what version of QuickTime do you have installed?
Yeah I can hear the shooting sound when open the WAV file directly with Safari (and whatever browser I tried), but I can't hear the sound when press "B" key for the page.
I have tried official WebKit nightly build r47288 for Windows and newest Chromium build, both didn't play the sound.