katspaugh / wavesurfer.js

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

Can not detect seek event #2123

Closed hey-code-everyday closed 3 years ago

hey-code-everyday commented 3 years ago

Hi, I am using wavesurfer js with React and it looks great. But I get an issue now.

I can not detect "seek" event and can not find a reason.

And when I click region it does not go to the current play time.

So please let me know the reason.

This image is when I click none region area. At this time the playtime goes to the current selected position. And I can detect seek event in this case. 1

But in this case ( when I click a region area) it does not change playtime. So can not detect seek event too. 2

Please help me if you know the reason. Thank you.

  const [waveSurfer, setWaveSurfer] = useState(null);

.....
setWaveSurfer(
      WaveSurfer.create({
        container: ".waveform",
        height: 150,
        scrollParent: true,
        normalize: true,
        minimap: true,
        minPxPerSec: 5,
        plugins: [
          RegionsPlugin.create(),
          MinimapPlugin.create({
            height: 30,
            waveColor: "#ddd",
            progressColor: "#999",
            cursorColor: "#999",
          }),
          TimelinePlugin.create({
            container: ".waveformTimeLine",
          }),
        ],
      })
    );
waveSurfer.on("seek", (e) => {
      console.log(e);
    });
marizuccara commented 3 years ago

Hi, which version of wavesurfer are you using? Maybe this conversation and relative issues are related with your question: https://github.com/katspaugh/wavesurfer.js/issues/2075#issuecomment-699716326

thijstriemstra commented 3 years ago

So please let me know the reason.

can you reproduce the issue without react? Please re-open with non-react example code, closing for now.