Open keylime-unicorn opened 6 years ago
I opened a PR on this issue. It seems that the node still needs to run the file to operate the visualisation, but the audio context can be safely disconnected. So all I've done is remove context from audiovisualiserung.js
@dsmith47 Your PR was merged as it solved the playback issue (#2). To clarify, this issue is based in the fact that if the client adds a song to the queue while another song is already playing, the visualisation on the client is linked to the most recent song uploaded by said client, not the song currently being played by the server.
So we need a server endpoint to distribute active songs and times and a client method to check at the end of each song. Are there any cases where active song changes mid-playthrough? Or can the client update on completion?
there is no current implementation for song changes before their completion, but skipping songs should be a possibility
If song can be skipped unexpectedly, then the client will need to check for server pause persistently. At that point, the clients will all pause out of sync whenever they send the pause signal.
A more stable implementation might be to have the server play the music and generate the visulisation, which it streams to the clients in pieces for better syncing and then stops serving whenever it enters a PAUSE state (simultaneous cutoff).
In that case, this issue becomes a server method to play music and simultaneously generate a visualization, and endpoint to server the current visualization, and a client handler to display the vis/pause gracefully.
Cool to do this if no one has problems with the design.
sounds perfect
Align all clients to see the song that is currently playing on the server, not the song that they just added to the queue.