Closed zerosonesfun closed 6 months ago
Finely observed. And I wish this wouldn’t have to happen. But alas, I have to cause the error even intentionally, or else the player will not work under iOS. Perhaps in a future iOS version this will become unnecessary. I will keep an eye on that. Sorry for that. Blame Apple... But be sure that this error alert can be ignored, and the player is indeed working.
For those who want to know why: It has to do with the principle that audio must be started by user interaction (which is good). By clicking the play button a cascade of functions is set off to initialize, load, buffer and finally play the audio. During this process the iOS Safari apparently loses the connection to the initial user interaction and ultimatley blocks the audio to play. The only solution that helped (so far) is to start and immediately stop the player right after the user click, before any other operation, and this returns the error alert because in that moment there is no audio file connected yet. One day there will be a version 2.0 with an entirely rebuilt architecture that will be much more elegant and avoids this problem.
Makes sense. Thank you for this amazing player! I've bundled it into a Flarum extension (forum software just in case you haven't heard of it): https://github.com/zerosonesfun/flarum-essential-audio
Good news: the Unhandled Promise Rejection issue is resolved! It now works without throwing errors in the newly released v2.0
After clicking play button the browser dev console shows this error: Unhandled Promise Rejection: AbortError: The operation was aborted.
It does not provide a line/file.
Player still works fine.