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
{{ message }}
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
Currently there is a bug where when I play an audio clip on iOS, FIRST the audio player opens up and says "Cannot play file", THEN the player gets ready and can play.
I suspect this is happening because iOS Safari does not grab metadata (it sets the html5 audio preload to "none"), but I have this play() event triggered in the onloadedmetadata:
So I'm thinking that iOS is trying to call this .play() function as soon as I hit the play button, but since there is no metadata, it is reporting that it cannot play the file.
I am thinking if I 1) surround onloadedmetadata with an IF statement that checks if the user is using a Safari mobile browser, or 2) if I put an IF statement within onloadedmetadata around the audio.play(), that somehow checks whether there is any value loaded in the metadata attribute.
I imagine 2 would be a better solution, but I'm not sure it's possible.
The text was updated successfully, but these errors were encountered:
Currently there is a bug where when I play an audio clip on iOS, FIRST the audio player opens up and says "Cannot play file", THEN the player gets ready and can play.
I suspect this is happening because iOS Safari does not grab metadata (it sets the html5 audio preload to "none"), but I have this play() event triggered in the onloadedmetadata:
So I'm thinking that iOS is trying to call this .play() function as soon as I hit the play button, but since there is no metadata, it is reporting that it cannot play the file.
I am thinking if I 1) surround onloadedmetadata with an IF statement that checks if the user is using a Safari mobile browser, or 2) if I put an IF statement within onloadedmetadata around the audio.play(), that somehow checks whether there is any value loaded in the metadata attribute.
I imagine 2 would be a better solution, but I'm not sure it's possible.
The text was updated successfully, but these errors were encountered: