Posted on

WavePlayer does not show any waveform when I move to a different page, unless I reload the browser.
How can I fix this?

The main script of WavePlayer initializes every instance of the player after the page completes loading.

If the theme you are using on your website loads pages through AJAX – which means that only a specific part of the content of the page gets updated without reloading the whole browser page – the script has already been invoked and cannot initialize those instance that are present in the new content of the page. In order to properly display the new players, it is necessary to call the initialization command right after the AJAX page loading completes. This command is:

If the theme implements callbacks triggered at the completion of the AJAX loading, it will be enough to add the line of code specified above to have all the instances of the player initialized.