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

Queue/Playlist API #2

Closed
Guichaguri opened this issue Apr 2, 2017 · 11 comments
Closed

Queue/Playlist API #2

Guichaguri opened this issue Apr 2, 2017 · 11 comments

Comments

@Guichaguri
Copy link
Collaborator

Guichaguri commented Apr 2, 2017

This is not only a good idea for general design, but it also helps for better performance on Chromecast devices.

APIs that are going to change:

  • setMetadata() will be removed. load() will be accepting metadata
  • load() can be called multiple times. The songs will be added to the queue
  • reset() will now reset the queue

APIs that are going to be added:

  • skip() will skip to a song based on ID
  • skipToNext() will skip to the next song
  • skipToPrevious()will skip to the previous song
  • Functions for removing/clearing the queue without resetting the player

It might be a good idea to rename load() to something else

@Guichaguri
Copy link
Collaborator Author

For this API, I'll need the state to become more reliable, I think I'll have to remove the callback from load and implement it as an event.
play, pause and other functions will work even though the track is not yet loaded, so if you load and then play, the track will play after it was loaded.

@jasongrishkoff Are you okay with this change?

@jasongrishkoff
Copy link

Sounds great -- I was already firing play() inside the callback; can just run the afterwards.

@jasongrishkoff
Copy link

Been keeping an eye on your commits. Let me know when I can help test this out.

@Guichaguri
Copy link
Collaborator Author

The playlist implementation is almost done, I'll let you know when it's ready for testing :)

@Guichaguri
Copy link
Collaborator Author

I think it's ready, I still haven't tested everything, but it should work.

@jasongrishkoff
Copy link

Great! Does the Wiki need updating?

@Guichaguri
Copy link
Collaborator Author

Yes, I'll update it tomorrow

@jasongrishkoff
Copy link

Thx! Going to today / this weekend.

@Guichaguri
Copy link
Collaborator Author

Guichaguri commented Apr 15, 2017

@jasongrishkoff I didn't have time to update the API page yet, but I have created a documentation page with every API function, constant or event. I'll try to work on the API page tomorrow.

Edit: It's updated now :)

@ashokkumar88
Copy link

@jasongrishkoff i can't find in the documentation or source code the load() function. Is this function renamed?

@jasongrishkoff
Copy link

@ashokkumar88 yeah this thread is nearly 1 year old, and the API has changed a lot since then!

ihutc pushed a commit to ihutc/react-native-track-player that referenced this issue Feb 20, 2019
chochihim pushed a commit to chochihim/react-native-track-player that referenced this issue Oct 13, 2019
mpivchev added a commit that referenced this issue Oct 6, 2021
* Add notification state event

* Properly stop service when needed

* Properly stop the service when needed #2

* Open app when clicking on notification

* Use new KotlinAudio event

* Refactor
kyo-torstar added a commit to kyo-torstar/react-native-track-player that referenced this issue Apr 3, 2024
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

3 participants