Skip to content

Changing playlist array doesn't rerender waveformΒ #18

@FractalPulv

Description

@FractalPulv
import React, { useEffect, useRef, forwardRef } from "react";
import AudioPlayer from "react-modern-audio-player";

const AudioPlayerWithWaveform = ({ playList }) => {
  useEffect(() => {
    console.log("playlist", playList);
  }, [playList]);

  return (
    <div>
      <AudioPlayer
        playList={playList}
        audioInitialState={{
          muted: false,
          volume: 0.2,
          curPlayId: 1,
        }}
        rootContainerProps={{
          width: "100%",
          position: "static",
        }}
        placement={{
          player: "selected-tracks",
          interface: {
            templateArea: {
              trackTimeDuration: "row1-5",
              progress: "row1-4",
              playButton: "row1-6",
              repeatType: "row1-7",
              volume: "row1-8",
            },
          },
        }}
        activeUI={{
          playButton: true,
          playList: false,
          prevNnext: false,
          volume: true,
          volumeSlider: false,
          repeatType: false,
          trackTime: true,
          trackInfo: false,
          artwork: false,
          progress: "waveform",
        }}
      />
    </div>
  );
};

export default AudioPlayerWithWaveform;

In the above code I can successfully swap the playlist object and can hear that a new track is playing (audio swap works) however the waveform visual doesn't get updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions