Re-trigger embed code after pagination loading content

Sure! Just remove the last code block, which is the one below.

  filterInstance.listInstance.on('switchpage', (targetPage) => {
    if (window.wavesurferBottom.isPlaying()) {
      globalPlayBtn.src =
        'https://assets-global.website-files.com/61f6c90352d29627cd69a979/661cdf745c4247757e19b954_play-buttton.png';
      window.wavesurferBottom.pause();
    } else {
      console.log('No audio playing');
      window.wavesurferBottom.pause();
    }
  });

My bad! I added this in case you were also going for that functionality

Thanks a lot! It works! Also, I switched to infinite and it solved the problem too. Thank you so much!

1 Like