You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling myHowlerObject.play(), the underlying call made to node.play() (https://github.com/goldfire/howler.js/blob/master/src/howler.core.js#L740) may fail under specific conditions.
My issue is that this failure is not detectable in any way by my code. Wrapping myHowlerObject.play() in a try/catch does not work, because the actual node.play() is probably called asynchronously. I've tried window.onerror too, without success.
Suggestion : wrap the node.play() in a try/catch in howler's code, and fire a new specific event like playerror if it fails, similar to the existing loaderror.
My use case :
I'm trying to play a sound immediatly when the user arrives on a page (not triggedred by a user gesture). This is restricted on some mobile browsers, making the node.play() call fail. I would still like to have that autoplay if possible and be able to detect when it was blocked, and it that case display something else in the UI to onboard the user and invite him to play the sound. See discussion #609
The text was updated successfully, but these errors were encountered:
When calling
myHowlerObject.play()
, the underlying call made tonode.play()
(https://github.com/goldfire/howler.js/blob/master/src/howler.core.js#L740) may fail under specific conditions.My issue is that this failure is not detectable in any way by my code. Wrapping
myHowlerObject.play()
in a try/catch does not work, because the actualnode.play()
is probably called asynchronously. I've tried window.onerror too, without success.Suggestion : wrap the
node.play()
in a try/catch in howler's code, and fire a new specific event likeplayerror
if it fails, similar to the existingloaderror
.My use case :
I'm trying to play a sound immediatly when the user arrives on a page (not triggedred by a user gesture). This is restricted on some mobile browsers, making the
node.play()
call fail. I would still like to have that autoplay if possible and be able to detect when it was blocked, and it that case display something else in the UI to onboard the user and invite him to play the sound. See discussion #609The text was updated successfully, but these errors were encountered: