simple-peer icon indicating copy to clipboard operation
simple-peer copied to clipboard

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

Open yugkha3 opened this issue 1 year ago • 3 comments

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);
	})

yugkha3 avatar Sep 10 '22 13:09 yugkha3

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

ffxixslh avatar Sep 18 '22 10:09 ffxixslh

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

no man, wbu?

yugkha3 avatar Oct 05 '22 12:10 yugkha3