wavesurfer.js
wavesurfer.js copied to clipboard
Wavesurfer on Safari never responds to Ready on file loading
Wavesurfer.js version(s):
Latest
Browser and operating system version(s):
Safari latest, iOS latest
Code needed to reproduce the issue:
(Please reduce your code as much as possible and only post the minimum code needed to reproduce the issue. A Code pen is an excellent way to share such code)
Load a file via file input dialog
Wavesurfer never triggers
this.wavesurfer.on("ready", () => {
this.isLoading = false;
});
so it just sits on the loading animation.
Works fine on Windows/Android.
Use behaviour needed to reproduce the issue:
Load a file via file upload
Similar to https://github.com/katspaugh/wavesurfer.js/issues/1567 https://github.com/katspaugh/wavesurfer.js/issues/1415
But these have been closed and the same issue still exists. I could not get the suggestion solution re: microphone working with loading files via file dialog. It just never seems to return to the ready callback, no matter what hacks I tried creating wavesurfer with a context.
Which backend are you using? you could try the waveform-ready event instead. I think with MediaElement, only waveform-ready is emitted, but with other backends, both ready and waveform-ready are emitted but I could be wrong about that.
waveform-ready – Fires after the waveform is drawn when using the MediaElement backend. If you're using the WebAudio backend, you can use ready.
From this page: https://wavesurfer-js.org/docs/events.html
Using the default, but I tried it on the other one as well and it still fails on iOS.
I confirm this issue, it seems to happen only when using the MediaElement backend and passing the peaks parameter to the load function. The behavior described by the documentation instead, provides that the ready event is emitted when the audio is ready to play while the wave-ready event when the waveform has been drawn.
@sonicviz have a look at this sample and try it out on your ios device, https://www.entonbiba.com/lab/ios2.html
do you have your code available somewhere to look at with the upload function you mention?
@sonicviz have a look at this sample and try it out on your ios device, https://www.entonbiba.com/lab/ios2.html
do you have your code available somewhere to look at with the upload function you mention?
I just tried this on Chrome, Safari, and IOS Safari. It plays back fine on IOS Safari, but does not playback properly on Safari for OSX.
@hal2814 version of OSX and Safari are you using latest or ?
Does someone figure out how to solve this problem? Still buggy on Safari 15.3.
This still doesn't work for me on iOS. The issue is marked as closed but I don't see any fix. I tried using the version 7.7.3 and the "ready" event is never fired on iOS, even with a direct user interaction.
Please open a new issue and add a snippet of your code, the audio URL and the iOS version.