Wavesurfer.js: BUG: waveform-ready event isn't triggered anymore if mediaelements and peaks and preload is none

Created on 1 Aug 2020  路  5Comments  路  Source: katspaugh/wavesurfer.js

Hi,

Wavesurfer v4.0.1.x, with FireFox

It seems waveform-ready event isn't triggered if backend is set to MediaElement, peaks are providen and preload is set to none.

It is weird cause the waveform is drawn so we might expect this event to be triggered.

Probably related to https://github.com/katspaugh/wavesurfer.js/pull/1990

Thanks !

bug

All 5 comments

Note: the code I had which used to work before v4.0.1 and v4.0.0 (and which lead me to this issue) simply with the "ready" event but I guess it would be more accurate to have waveform-ready now.

Hi, the waveform-ready should trigger when peaks are not provided, but decoded with the Web Audio features

@marizuccara before 4.0.1, ready event was called when peaks were drawn, if peaks were providen (preload set to false).
With 4.0.1 update on ready state, this event isnt trigger anymore. I would expect that at least the waveform-ready event would be called instead as it was designed to be trigger when the waveform is drawn.
Unless I miss a new type of event there ?

Tested it and you're right. With MediaElement backend , in the situation that you described, the ready event is triggered when the tag audio starts to play. As you suggested, we can trigger the waveform-ready event when waveform is drawn.

@marizuccara thanks for your consideration !

Was this page helpful?
0 / 5 - 0 ratings