leoasis / react-sound

Sound component to play audio in your web apps
ISC License
491 stars 80 forks source link

Not play in chrome 66 #67

Open frank780117 opened 6 years ago

frank780117 commented 6 years ago

hi, sometimes not play sound, can you add mute or other property then I can use.

https://stackoverflow.com/questions/49930680/how-to-handle-uncaught-in-promise-domexception-play-failed-because-the-use

glodfinch commented 6 years ago

I also have this issue with Chrome. Strangely sometimes the sounds will play and sometimes they wont. Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

alaingoldman commented 6 years ago

Same issue as above ^

pallavi1993 commented 6 years ago

It is because of the chrome's browser setting.

justintemps commented 6 years ago

Indeed. It's because of this: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

You need to listen for a user interaction before you set the playStatus to Sound.status.PLAYING

andykotov commented 4 years ago

Please help to resolve this issue, I have the same warning

soundmanager2.js:1989 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

derakhshanfar commented 4 years ago

any update here guys?

glodfinch commented 4 years ago

This turned out to be exactly what the error says - the user needs to interact with the page before you can autoplay sounds. I now have a small banner at the top of the page asking for autoplay permission, with a button for the user to click. Works great.