I’d like to see a waveform for each song in my playlist
I have employed <div class="amplitude-wave-form" data-amplitude-song-index="{index}"></div> for that
It works great for songs that have been played and thus been loaded by AmplitudeJS
What I’d like to do is is have the waveform rendered before or even without the song actually being played. So basically trigger the WaveForm.build() again for all or one specific song.
Is there a way to achieve this?
To accomplish this (and to avoid downloading all songs every time the page loads),
I generate my own peaks and svg paths on the server and then pass them into Amplitude.getConfig().waveforms.built. This however does not trigger a re-rendering of the waveforms. Passing the waveforms in the Amplitude.init({ waveforms: { built: [...] } }) method unfortunately does not work (probably because the config object gets overridden).
I’m facing the same issue. I would like to display every song’s waveform after Amplitude initialization. Rigth now, it shows only first waveform, rest keeps empty till song play occurs.
I would like to know how did you generate your own peaks and svg paths, I can’t find any documentation for Amplitude about this.
Thanks!