jaysalvat / buzz

Buzz is a small but powerful Javascript library that allows you to easily take advantage of the new HTML5 audio element. It tries to degrade silently on non-modern browsers.
http://buzz.jaysalvat.com
MIT License
1.21k stars 227 forks source link

Sounds do not play in Safari +1 #80

Open guoguofish opened 10 years ago

guoguofish commented 10 years ago

The following results from my testing: Complete Success: My codes in Chrome on OS X 10.9.5 ( MacBookPro ) Your demo in Chrome on OS X 10.9.5 ( MacBookPro )

Partial success: Your demo in Safari on OS X 10.9.5 ( MacBookPro ) A sound by clicking a letter work only once .

Failure: My codes in Safari(v6-8) on OS X 10.9.5 ( MacBookPro ) My codes in Chrome on IOS(v7-8) ( ipad2 ) My codes in Safari on IOS(v7-8) ( ipad2 )

I inspect "loadstart" event and the others.

_mySound.bind('loadstart',function(e){ // debug $('#tm-debug').append( '

buzz:loadstart event > '+Object.keys(e)+'

'); });

Result is " buzz:loadstart event > clipboardData " when failure. Then others event are not triggered.

Result is " buzz:loadstart event > clipboardData,path,cancelBubble,returnValue,srcElement,defaultPrevented,timeStamp,cancelable,bubbles,eventPhase,currentTarget,target,type " when success.Then others event are normal.

christian-fei commented 8 years ago

stumbled upon the same issue https://github.com/christian-fei/pomodoro.cc/issues/57 do you have any updates?

jaysalvat commented 8 years ago

Hello,

It works well for me on Safari. Impossible to reproduce the problem on Safari desktop. Safari IOS doesn't allow to set volume or autoplay sound. It's a known limitation, not a bug.

@christian-fei It seems Safari doesn't work well with webAudioApi. Set webAudioApi to false.

christian-fei commented 8 years ago

ooooh, thanks will try!