I tried several ways to change my music without success.
The only solution I found was to create a new player(new APlayer({...options, music: newMusic}) whenever the music change(inside the watch).
Why I did that ? APlayer won't detect a change in the music, it instantiate a new player with every possible music and it has a couple of functions to deal with changes like .addMusic(newMusics) but it has nothing to replace the current music playing. That's why I'm creating a new instance and replacing it. It worked nicely.
I tried to pass the music inside an array [newMusic] which won't raise an error and will trigger the changes of the pic and everything but not the music.
I don't know if anyone had this issue. But I'm forking and will be using mine meanwhile, I will open a PR if you find this helpful . For now, the player is not reactive and I think that should be a most for the Vue version.
Feel free to close this if you wish, is more a reporting and discussion kind of issue. Could be helpful for people with the same issue.
I got an error within the watch when changing a single music(as an object).
For what I could find this is that APlayer try to access the music as an Array when you use
.setMusic(0)
(here: https://github.com/SevenOutman/vue-aplayer/blob/master/src/vue-aplayer.vue#L67) You can check more about APlayer in here: https://github.com/MoePlayer/APlayer/blob/master/src/APlayer.js#L449I tried several ways to change my music without success.
The only solution I found was to create a new player(
new APlayer({...options, music: newMusic}
) whenever the music change(inside the watch).Why I did that ? APlayer won't detect a change in the music, it instantiate a new player with every possible music and it has a couple of functions to deal with changes like
.addMusic(newMusics)
but it has nothing to replace the current music playing. That's why I'm creating a new instance and replacing it. It worked nicely.I tried to pass the music inside an array
[newMusic]
which won't raise an error and will trigger the changes of the pic and everything but not the music.I don't know if anyone had this issue. But I'm forking and will be using mine meanwhile, I will open a PR if you find this helpful . For now, the player is not reactive and I think that should be a most for the Vue version.
Feel free to close this if you wish, is more a reporting and discussion kind of issue. Could be helpful for people with the same issue.