I have a problem using back-end media elements with peaks in this library the peaks stopped working or did not appear when I try to get the audio from a database connected to the back-end... on the other hand, when I use the audio directly on the client-side the peaks work just fine because I didn't have to use media elements with this option!
Does anyone have an idea?
here is a code snippet...
wavesurfer = WaveSurfer.create({
container: waveformRef.current,
waveColor: "#747993",
height: 90,
responsive: true,
progressColor: "#393F65",
normalize: true,
backend: "MediaElement",
plugins: [
RegionsPlugin.create({
dragSelection: {
slop: 5,
color: "hsla(9, 100%, 64%, 0.1)",
},
}),
TimelinePlugin.create({
container: "#timeline",
formatTimeCallback: formatTimeCallback,
timeInterval: timeInterval,
primaryLabelInterval: primaryLabelInterval,
secondaryLabelInterval: secondaryLabelInterval,
primaryColor: "#2A045A",
secondaryColor: "#747993",
primaryFontColor: "#2A045A",
secondaryFontColor: "#747993",
formatTime: "HH:MM:SS",
}),
],
});
wavesurfer.load(audioUrl);