lijinke666 / react-music-player

[Stop the maintenance] :musical_note: Maybe the best beautiful HTML5 responsive player component for react :)
https://lijinke666.github.io/react-music-player/
MIT License
694 stars 204 forks source link

Giving a null issue onDestroy #544

Open Prasundas99 opened 6 months ago

Prasundas99 commented 6 months ago

Version

"react-jinke-music-player": "^4.24.2", "react": "^18.2.0",

Description

Getting this error when i destory a player using the (X) cross button and then play a new song

image

const MusicPlayer = ({ audioLists = [], currentSongIndex = "" }) => {
  const playIndex = audioLists.findIndex(
    (song) => song.id === currentSongIndex
  );
  return (
    <ReactJkMusicPlayer
      audioLists={audioLists ?? []}
      mode="full"
      theme="dark"
      autoPlay={true}
      toggleMode={false}
      showThemeSwitch={false}
      showDownload={false}
      showReload={false}
      playIndex={playIndex ?? 0}
      showDestroy={true}
    />
  );
};

Expected Behavior

It should play the new song

Current Behavior

image image