You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When skipping a song I've noticed that the DJ (myself, in this case) will appear to step down and then step up again and resume playing the next song.
Ideally the expected behavior is for the active DJ to be passed onto the next DJ in line or seamlessly skip to the next song if you are the only DJ on stage (in my case I was the only DJ).
The text was updated successfully, but these errors were encountered:
stevenleeg
changed the title
When skipping song DJ appear to step down
DJ appears to step down while skipping song
Jun 9, 2014
I introduced this delay in 8b6def3 for skipping from a single DJ to themself, to prevent a race condition in the WebRTC signaling. When skip is triggered, the DJ removes the stream for the current song from their peer connections with the other users in the room, and then adds a new stream to each peer connection, with the new track. Both removing and adding the stream trigger a negotiationneeded event, which we listen on to renegotiate the PeerConnection (offer, answer, exchange ICE candidates). Initiating the renegotiation twice without waiting for the response seemed to put the peer connection in a bad state and caused an error.
The delay does look a bit sloppy. We could handle this more cleanly by detecting when negotiationneeded is going to be fired twice, and only start renegotiation after the second time. This could be done by using a debounce function, or by manually triggering the renegotiation instead of using the negotiationneeded event. Or, reuse the same stream for the new track so the connection doesn't have to be renegotiated at all.
When skipping a song I've noticed that the DJ (myself, in this case) will appear to step down and then step up again and resume playing the next song.
Ideally the expected behavior is for the active DJ to be passed onto the next DJ in line or seamlessly skip to the next song if you are the only DJ on stage (in my case I was the only DJ).
The text was updated successfully, but these errors were encountered: