Open Kubera2017 opened 6 years ago
This may be a bug with simplewebrtc. Looks like when you leave the room we call end
on a peer and handleStreamRemoved()
but don't actually null out the stream. Then later, when you get a new stream for them, it gives that message.
@Kubera2017 could you try this in onLeaveRoom -
console.log('Closing');
webrtc.stopLocalVideo();
webrtc.leaveRoom(room);
webrtc.webrtc.peers.forEach(function (peer) { peer.stream = null });
If that fixes your problem, then we may just need to null out the stream when leaving. Let me know.
I have the same problem. I tried. Unfortunately, the solution doesn't help.
I also have the same problem
@Kubera2017 if you don't have this problem anymore, can you resolve this thread?
The problem is still exists. And this is the one of crucial features witch is required for building apps with the framework.
alright
stopLocalVideo don't remove the localStreams array in webrtc. You have to reset this array.
I try to build video chat application with multiple rooms. Users can open the site, joins existed (prefixed) rooms, leaves them and rejoin.
First client joins the room, gets into the room, wait for another client, establish the connection. Then second client leaves the room and rejoin. Second's clients action will be "join room" -> "leave it" -> "rejoin the room".
First client log:
At second visit first client can't take video stream: latest-v3.js:12639 Already have a remote stream
I make webrtc.startLocalVideo() when client joins room and webrtc.stopLocalVideo() when leaves.
If I bypass webrtc.stopLocalVideo() (don't stop user's camera even then he is not in room) all is ok.