katspaugh / wavesurfer.js

Audio waveform player
https://wavesurfer.xyz
BSD 3-Clause "New" or "Revised" License
8.64k stars 1.62k forks source link

Problem with interact option #1863

Closed mehranranji closed 1 year ago

mehranranji commented 4 years ago

Hello friends

There was a problem for me that I couldn't find the answer to

Although I set the value of "interact" to "true", it clicks on the sound wave play from the beginning

my constructor:

audioContext: audiocontext,
container: soundWaveContainers[index],
waveColor: "#999",
progressColor: "#00ffaf",
cursorColor: "#999",
height: 52,
mediaType: "audio",
normalize: false,
hideScrollbar: false,
mediaControls: true,
interact: true,
backend: "MediaElement",

load:

wavesurfer.load(streamURL, soundPeaks);

thijstriemstra commented 4 years ago

it clicks on the sound wave play from the beginning

can you explain, not sure what you mean.

mehranranji commented 4 years ago

I load the sound file with the predefined peaks with the command below:

wavesurfer[index].load(item_sound_url, item_sound_peaks, "auto");

But by clicking on the waveform when the interact value is true, the sound is played back from the beginning.

This is not a problem if I don't load the sound without predefined peaks and the sound can be easily dragged back and forth. for example:

wavesurfer[index].load(item_sound_url);