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

"Play Next" #114

Closed
deluan opened this issue May 27, 2020 · 9 comments
Closed

"Play Next" #114

deluan opened this issue May 27, 2020 · 9 comments

Comments

@deluan
Copy link

deluan commented May 27, 2020

Description

I couldn't find a way to add a song to the queue to be played immediately after the current song, similar to iTunes, Apple Music and Google Play Music.

Ex:

audioLists:
"A"
"B" <- currently playing,
"C"

In this situation, how can I add a song "D" to be played after "B" without stoping the player, so that audioLists becomes:
"A"
"B" <- currently playing,
"D"
"C"

Note that it is important to not remove any songs from the list and to not interrupt the player.

Is it currently possible?

@lijinke666
Copy link
Owner

I see what you mean, this feature is not supported for the time being.
but i think it's a good idea.

@lijinke666
Copy link
Owner

🎉 https://github.com/lijinke666/react-music-player#bulb-custom-operation-ui

@deluan
Copy link
Author

deluan commented Aug 17, 2020

Hey, sorry for commenting on an old issue, but I just tried to add this to my project, and I'm not sure if I got it right: In my project, I add songs to the audioLists using actions and Redux, so I can dispatch new songs from anywhere in the code.

Seems like this new functionality (appendAudio) is a imperative method of the audio component, right? This means that I would have to expose this audio component to other parts of the application, instead of using the current approach of dispatching actions, is that correct?

IMHO, I think appending new songs to the audioLists should be implemented declaratively, similar to how you currently add songs to the end. If I wanted a song to be put in a specific position of the audioLists, I'd just insert it in the position I want, and the play queue would reflect that new audioLists.

Or maybe I just don't understand how I could use this new feature...

@lijinke666
Copy link
Owner

I know you mean. you mean always maintain a unique data source from redux store , it's audioLists, like

const audioLists = [A, B]
const audioLists = [A, B, C]
dispatch(audioLists)

https://github.com/deluan/navidrome/blob/aae9d89e8caeb21d84a76c30a64782fb3b7cee07/ui/src/audioplayer/Player.js#L97

current player behavior is reset current audio play state when audioLists changed. maybe i can add a new option to support this feature? Is that what you mean? do I get it right ?

@deluan
Copy link
Author

deluan commented Aug 28, 2020

Yes, that's what I meant! A better example related to the "Play Next" feature of this issue is:

const audioLists = [A, B]

Now A is playing, put C before B without interrupting the player

const audioLists = [A, C, B]
dispatch(audioLists)

Thanks!

@reviewflow
Copy link

reviewflow bot commented Feb 4, 2021

This will be auto filled by reviewflow.

3 similar comments
@reviewflow
Copy link

reviewflow bot commented Feb 4, 2021

This will be auto filled by reviewflow.

@reviewflow
Copy link

reviewflow bot commented Feb 4, 2021

This will be auto filled by reviewflow.

@reviewflow
Copy link

reviewflow bot commented Feb 4, 2021

This will be auto filled by reviewflow.

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

No branches or pull requests

2 participants