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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user