-
Notifications
You must be signed in to change notification settings - Fork 343
collectIceCandidates function param details #11
Comments
You can see the branch 'solution', is not related to what you see on webrtc.org but it's something. You can assume that:
|
thank you for your help sir @JaviLopezG one more question I successfully create the peer connection but it works only when the caller and the callee are using same router connection but when they are in different network it's not working why ? |
here is my app.js file mdc.ripple.MDCRipple.attachTo(document.querySelector('.mdc-button')); const configuration = { let peerConnection = null; function init() { async function createRoom() { console.log('Create PeerConnection with configuration: ', configuration); registerPeerConnectionListeners(); localStream.getTracks().forEach(track => { // Code for collecting ICE candidates below peerConnection.addEventListener('icecandidate', event => { // Code for creating a room below const roomWithOffer = { peerConnection.addEventListener('track', event => { // Listening for remote session description below // Listen for remote ICE candidates below function joinRoom() { document.querySelector('#confirmJoinBtn'). async function joinRoomById(roomId) { if (roomSnapshot.exists) {
} async function openUserMedia(e) { console.log('Stream:', document.querySelector('#localVideo').srcObject); async function hangUp(e) { if (remoteStream) { if (peerConnection) { document.querySelector('#localVideo').srcObject = null; // Delete room on hangup document.location.reload(true); function registerPeerConnectionListeners() { peerConnection.addEventListener('connectionstatechange', () => { peerConnection.addEventListener('signalingstatechange', () => { peerConnection.addEventListener('iceconnectionstatechange ', () => { init(); |
Actually, I don't know. I am a total newbie on WebRTC and I am trying to figure out how to implement it. I tested a code similar to yours and it worked for me. It could be that one of your devices is under firewall protection or something like that and you need to use a TURN server instead of a stun one. There are some public servers that you can use to test it. |
collectIceCandidates(roomRef, peerConneciton, localName, remoteName) what I need to pass for param localName and remoteName
The text was updated successfully, but these errors were encountered: