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

Cannot recreate player after it has been destroyed #96

Closed
deluan opened this issue Apr 13, 2020 · 4 comments
Closed

Cannot recreate player after it has been destroyed #96

deluan opened this issue Apr 13, 2020 · 4 comments
Labels

Comments

@deluan
Copy link

deluan commented Apr 13, 2020

Version

4.10 - 4.11.1

Description

If I destroy the player (using the destroy btn or the "close" btn from the MediaSession), I can't find a way to display it again when I want to play more music

Steps to Reproduce

  1. Go to the demo site,
  2. After it starts playing music, click on the destroy btn
  3. Now there's no way to make the player start again

Expected Behavior

After destroying the player, if I add more songs to the audioLists property, it should create a new player and start playing the new music

Current Behavior

There's no way to play more songs after the player has been destroyed. The only solution is to refresh the page so the <ReactJkMusicPlayer> is recreated

Comments

If you feel like this is not something you want to support, at least do not set the navigator's "stop" handler if showDestroy is false

@lijinke666
Copy link
Owner

at least do not set the navigator's "stop" handler if showDestroy is false

yes, it's a bug, i will optimize the issue, thank your feedback

After destroying the player, if I add more songs to the audioLists property, it should create a new player and start playing the new music

i think maybe add a new api like this.audioInstance.rerender() to support more usage scenarios

@deluan
Copy link
Author

deluan commented Apr 14, 2020

i think maybe add a new api like this.audioInstance.rerender() to support more usage scenarios

If I understand your proposal well, I think it would be messier from a the client's code perspective, as I'd have to control when the destroy button was clicked, keep this "state". I think it would be easier if the player handles it automatically: If you add songs to it, it shows the player if not already shown, as it does on first usage.

@lijinke666
Copy link
Owner

Do you mean to make the destroy of the player like hidden, not remove dom element, if playlist changed, to display player ?

@lijinke666
Copy link
Owner

i'm released version 4.11.2, the close button form the MediaSession scope is pause the music ,
And should not destroy player, you can upgrade for your navidrome :), i'm sorry to trouble you

about the cannot recreate player after it has been destroyed. we can talk that this is indeed a feature. will todo

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

No branches or pull requests

2 participants