Wavesurfer.js: Problem displaying multiple waves

Created on 13 Jan 2020  路  2Comments  路  Source: katspaugh/wavesurfer.js

I'm trying to display more than one waveform on the same page but I think I'm missing something crucial. Only the first audio from an object is rendered, because they all share the same container. Am I doing it wrong somehow?
Pen for reference:
https://codepen.io/cusanag/pen/abzEmmo

Thank you.

question

All 2 comments

@cesanag you need to create a new div for each waveform and create a new WaveSurfer instance for each div

var wavesurfer1 = WaveSurfer.create({
            container: "#waveform1",
            backgroundColor: 'rgb(10, 10, 10)'
});

var wavesurfer2 = WaveSurfer.create({
            container: "#waveform2",
            backgroundColor: 'rgb(10, 10, 10)'
});

Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diegoiglesias picture diegoiglesias  路  3Comments

thijstriemstra picture thijstriemstra  路  3Comments

Trojan0523 picture Trojan0523  路  3Comments

daslicht picture daslicht  路  3Comments

thijstriemstra picture thijstriemstra  路  5Comments