feross / simple-peer

📡 Simple WebRTC video, voice, and data channels
MIT License
7.36k stars 972 forks source link

stream channel not working when data channel is used along with stream channel #899

Open yugkha3 opened 2 years ago

yugkha3 commented 2 years ago
peers[connectedUserSocketID].on('stream', (stream) => {
        streams.set(connectedUserSocketID, stream);
        store.dispatch(setStreams({ connectedUserSocketID }));
    });

When i only use the above event listner 'stream' everything works fine. But when I use both the below 'stream' and 'data' event listners the 'stream' event does not trigger properly. Here's the code with both stream listners:

peers[connectedUserSocketID].on('stream', (stream) => {
        streams.set(connectedUserSocketID, stream);
        store.dispatch(setStreams({ connectedUserSocketID }));
    });
peers[connectedUserSocketID].on('data', (data) => {
        const messageData = JSON.parse(data);
        appendMessage(messageData);
    })
ffxixslh commented 1 year ago

I've got the same problem. Have you got it fixed yet?🤣

yugkha3 commented 1 year ago

I've got the same problem. Have you got it fixed yet?🤣

no man, wbu?

luyaocode commented 6 months ago

I have the same problem too.