feat: Implement dynamic video quality selection and mid-stream source switching, improve viewer connection handling by closing old connections, and optimize broadcaster notifications.

This commit is contained in:
2026-02-23 05:45:33 +01:00
parent 0d7a51ddcd
commit deab4dd4a0
4 changed files with 102 additions and 6 deletions

View File

@@ -15,6 +15,11 @@ const config = {
};
socket.on('offer', (id, description) => {
// Close any existing connection before creating a new one
if (peerConnection) {
peerConnection.close();
peerConnection = null;
}
peerConnection = new RTCPeerConnection(config);
peerConnection.ontrack = event => {