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
How to replace songs array? #184
Comments
Hey @fiter92, Thanks for using Amplitude! @danpastori is traveling right now and he'll be the best one to answer your question. He'll be back next week and I will be sure to have him reach out to you on this question once he returns. |
@fiter92 Awesome you are using Amplitude with VueJS, I've been thinking about doing a component for awhile. I love VueJS and would want Amplitude to be coupled really easily with it. Anyways what is your use case? Do you have a library of songs on a server and you want to update a list dynamically? |
I'm in the same boat as @fiter92 ... I have a single-page-app that queries my song database and displays individual albums. Every time another album is shown, I'd need to re-initialise the song list. Risking to get very off-topic here, but a public playByIndex() and stop() function would be helpful for me :) |
I have similar situation, right now to change array I'm re-initializing the player with new song array and before initializing I have to pause previous song otherwise it will play in background while the new ones are playing, is this viable solution? Is there any better way to do this? |
@enemyss I'd do a solution like the following: Start with 10 songs, add 10 more songs. Once you add another 10 songs remove the first 10. Does that make sense? Then you wouldn't be needing to pause the song because it's being removed from the songs array. Or am I missing what you are trying to accomplish? |
@danpastori thanks for replying, I just tried adding new songs and removing old ones, but then the player current song is from previous song list and I have to call Amplitude.next() or press next to get to the new song and also by adding X new songs for each one I get "uncaught promise error" in console though I'm not sure how crucial is that since it seems to not affect anything. And since with songAdd/remove I have to use cycle won't it be slower than initializing new array? |
This is what I'm doing to load a new playlist, It seems to be working fine.
|
@dakotahmartin Thanks for providing your solution! Handling large amounts of files is something I've been wanting to research and making sure it's efficient. If there are any ideas or solutions definitely post them here, but I'll be doing some research as well and making sure I can come up with something that works effectively and efficiently! |
How does the initAmplitude() look like for you. Can I do Amplitude.songs = newSongsArrayFromServer? |
This is now being tracked in our roadmap. We want to spend some time to make sure we can handle thousands of files with ease. |
Any progress on this issue, of loading new playlists? I'm currently having difficulty in removing an old array of playlists and loading a new one. When calling |
Hello!
Thanks for a good work!
I've got about 50000 songs and a lot of playlists, and I can't just initialize Amplitude.js with a ton of songs... If user listen a single playlst I could just load a new songs by ajax and use .addSong method, that's works fine. BUT that doesn't works if user changes a playlist and I have to remove all songs form the player and fill it with a new songs... Is there some way to do this?
p.s. I'm using vuejs and trying to get some reactivity
The text was updated successfully, but these errors were encountered: