These are chat archives for andyet/SimpleWebRTC

5th
Mar 2017
Mat
@mateuszMad_twitter
Mar 05 2017 10:32
my mistake was i create every new connection - webrtc = new SimpleWebRTC...
I've changed to:
<script>
var webrtc = null;
function startconf() {
if ( webrtc == null || webrtc === 'undefinied' ) {
webrtc = new SimpleWebRTC({
localVideoEl: 'localVideo',
remoteVideosEl: 'remotesVideos',
autoRequestMedia: true
});
} else {
webrtc.startLocalVideo();
webrtc.joinRoom('java.org.pl');
}
webrtc.on('readyToCall', function () {
webrtc.joinRoom('java.org.pl');
});
};
function hangUp() {
if (webrtc !== null) {
webrtc.stopLocalVideo();
webrtc.leaveRoom();
}
}

</script>
but now when I leave room and connect againt I have 3 remote video of me
every new connection is added new remote video of me
on second computer where I have constatnt connection I see one remote video and is OK
Mat
@mateuszMad_twitter
Mar 05 2017 10:44
OK I've changed:
<script>
var webrtc = null;
function startconf() {
if ( webrtc == null || webrtc === 'undefinied' ) {
webrtc = new SimpleWebRTC({
localVideoEl: 'localVideo',
remoteVideosEl: 'remotesVideos',
autoRequestMedia: true
});
webrtc.on('readyToCall', function () {
webrtc.joinRoom('java.org.pl');
});
} else {
webrtc.startLocalVideo();
webrtc.joinRoom('java.org.pl');
}
};
function hangUp() {
if (webrtc !== null) {
webrtc.stopLocalVideo();
webrtc.leaveRoom();
}
}

</script>
but now I have one picture not video which is not cleared, so always I have two remote video of me