Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property "remember: true," is not working. #477

Open
nhridoy opened this issue Mar 20, 2022 · 0 comments
Open

Property "remember: true," is not working. #477

nhridoy opened this issue Mar 20, 2022 · 0 comments

Comments

@nhridoy
Copy link

nhridoy commented Mar 20, 2022

Description

I am using this package on my application. But I have a problem with the remember property. It was supposed to remember the last state of the playlist, which means the last song I was playing. So, if I reload the page, I can continue from that song. When I am playing a song some data is being saved on the local storage. But when I reload the page, the local storage data seems to be reset to the first song of the playlist.

Below is my code

const options = {
    glassBg: true,
    drag: false,
    seeked: true,
    toggleMode: true,
    autoPlay: false,
    clearPriorAudioLists: false,
    autoPlayInitLoadPlayList: false,
    showMiniProcessBar: true,
    showMiniModeCover: true,
    showProgressLoadBar: true,
    showPlay: true,
    showReload: true,
    showDownload: false,
    showPlayMode: true,
    showThemeSwitch: false,
    showLyric: true,
    showDestroy: false,
    preload: "auto",
    remove: false,
    remember: true,
    spaceBar: true,
    responsive: true,
    autoHiddenCover: true,
    quietUpdate: true,
    restartCurrentOnPrev: true,
    showMediaSession: true,
    theme: "auto",
    defaultPosition: { right: "4vw", bottom: "2vh" },
    bounds: { right: "4vw", bottom: "2vh", left: "4vw", top: "2vh" },
    sortableOptions: {
      sort: false,
      swap: false,
    },

    // defaultPlayIndex: 0,
    // theme: "dark",
    // mode: "full",

    // custom
    lyric: {
      color: "#fff",
      fontSize: "14px",
      textShadow: "0 0 5px #000",
    },
  };

<ReactJkMusicPlayer
        audioLists={fullPlayList}
        {...options}
      />

Data that is being saved on the local storage

{
    "currentTime": 0,
    "playId": "e4b28d31-7c65-5836-1eda-374edf89b522",
    "theme": "dark",
    "playMode": "order",
    "soundValue": 1,
    "name": "Al-Faatiha",
    "cover": "/static/media/logo.e4a082d466ccc7346f5b.png",
    "singer": 1,
    "musicSrc": "https://cdn.alquran.cloud/media/audio/ayah/ar.alafasy/1"
}

What is the issue? What am I doing wrong here and what should be done?
I appreciate the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant