">
I have a situation with a small button that works on Chrome but not on Safari. I've tried trying autoplay in different places with no success. What am I missing here? Please note that I do not have sounds posted online to share. I was initially using Base64 encoded sound files. If I could find a shorter one, I would edit this post, but SO's editor limits my posts to include this one.
音频播放和暂停
Here is a link to a JS Fiddle if it helps. Thanks.
https://jsfiddle.net/anonymouspenguin/kevhq7x1/1/
I'm not sure how to debug in Safari, but in Google Chrome I click on the ellipsis (3 vertical dots icon), select Settings, then Developer Tools.
Go to console>Clear console>Click your button
I got this error. The two onmouseup and ontouchpad properties in your button label conflict with other properties. Please remove them. Once playback is working properly, find the next error and continue.
Instead of putting the attributes in the button HTML tag, you can try this: