Problem with Player previous() method? #1967
-
First of all, what a fantastic library you have built. Thank you very much indeed! I have used the Player library to build a standalone music player from an SD card with a nice web interface, implemented using the built-in SD card of the ESP32Cam. Everything works, but I have encountered what appears to be a problem with the previous(0 method. When invoked, it goes back to the previous track, then to the track previous to that, plays it, and then playing stops (does not go to the next one). I made sure setAutoNext is true throughout. For now, I am not using the previous() feature, but I thought to point it out. next() works without a hitch. Since I am at it, is there any plan to implement looping? In other words, after all the tracks are played, this option rewinds to the first and starts playing? For now, I am catching a NULL return of play(), comparing the track # to the number of tracks, and using begin(), but it would be nice if it is a built-in option. Any maybe also single-track looping? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think you might have some missunderstanding: next(n) is used to navigate where n is the number of files. It can be negative to move back. If you don't specifiy a value a 1 is assumed: Thus next(0) and pervious(0) do not change the position at all! |
Beta Was this translation helpful? Give feedback.
I think you might have some missunderstanding: next(n) is used to navigate where n is the number of files. It can be negative to move back.
previous(n) is just a convinience method which does a next(-n);
If you don't specifiy a value a 1 is assumed: Thus next(0) and pervious(0) do not change the position at all!