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

Repeat doesn't work when playlists were initialized #471

Open
kaszarobert opened this issue Sep 9, 2021 · 0 comments
Open

Repeat doesn't work when playlists were initialized #471

kaszarobert opened this issue Sep 9, 2021 · 0 comments
Assignees
Labels
Bug: Needs Confirmation 🧐 Bugs that are reported, but needs to be confirmed and replicated.

Comments

@kaszarobert
Copy link

Issue description

If the song list was initialized with the "playlists" key in Amplitude.init(), then after clicking to an element with "amplitude-repeat" class, the player does not repeat the playlist. I wrote the steps to reproduce below.

It works when it was initialized with "songs" only (with no multiple playlist) as seen here: https://521dimensions.com/open-source/amplitudejs/docs/examples/blue-playlist.html

Also, repeating a single song (using "amplitude-repeat-song") on a playlist working with no problems, too.

Environment

  • What's My Browser Support link: Chrome 93
  • Amplitude.js Version: 5.3.2

Steps to reproduce the issue

  1. Go to https://521dimensions.com/open-source/amplitudejs/docs/examples/multiple-playlists.html
  2. Click to the repeat button on Playlist 1
  3. Go back to the previous (last track) called "Offcut # 6"
  4. Jump to the last few seconds

What is expected?

Expected:
After finishing "Offcut # 6", the first song in the playlist (Risin' High) should start.

Actual:
After finishing "Offcut # 6", the playback stops after it jumps to the first song.

Link to where issue can be reproduced

https://521dimensions.com/open-source/amplitudejs/docs/examples/multiple-playlists.html

Additional details / screenshots

In src/utilities/audioNavigation.js the setNextPlaylist(playlist) function, the code that decides if it should start the playback checks on the global object.

    if (endOfList && !config.repeat) {
    } else {
      if (!(songEnded && !config.repeat && endOfList)) {
        Core.play();
      }
    }

Shouldn't this check on the current playlist instead? Like that:

    if (endOfList && !config.playlists[playlist].repeat) {
    } else {
      if (!(songEnded && !config.playlists[playlist].repeat && endOfList)) {
        Core.play();
      }
    }
@kaszarobert kaszarobert added the Bug: Needs Confirmation 🧐 Bugs that are reported, but needs to be confirmed and replicated. label Sep 9, 2021
@danpastori danpastori self-assigned this May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Needs Confirmation 🧐 Bugs that are reported, but needs to be confirmed and replicated.
Projects
Status: Being Documented
Development

No branches or pull requests

2 participants