WebDevSimplified / Zoom-Clone-With-WebRTC

1.52k stars 865 forks source link

Cant see video of other person that connected #52

Open darja2001 opened 3 years ago

darja2001 commented 3 years ago

Hi, when I do localhost:3000 i can see my own camera. But when i open a new tab or go on new device and do publicip:3000, I cant see any camera. And on localhost no new camera pops up. When I click on inspect in chrome with link localhost:3000 I see these errors: Failed to load resource: net::ERR_CONNECTION_REFUSED :3001/peerjs/id?ts=16144187843870.6479763634269047:1

and on second tab with public ip i get these errors: Uncaught TypeError: Cannot read property 'getUserMedia' of undefined at script.js:10 Failed to load resource: net::ERR_CONNECTION_REFUSED :3001/peerjs/id?ts=16144187843870.6479763634269047:1

swayam1998 commented 3 years ago

I am having the same problem

AaronLazarusGomes commented 3 years ago

Hi, so I came across a solution for this... just do the following manipulation to the already existing code

const peer = new Peer(undefined, { host: "peerjs-server.herokuapp.com", secure: true, port: 443, });

The thread on this could be found here https://stackoverflow.com/questions/44943254/get-https-127-0-0-19000-peerjs-peerjs-idts-14993271469660-591159722513086-ne

Hope this helps! Cheers

darja2001 commented 3 years ago

@AaronLazarusGomes Thanks, it did solve one error but im still struggling with the getUserMedia error, any ideas?

pramodya1994 commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

AaronLazarusGomes commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

pramodya1994 commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

There's no error, But when I joined the video using another browser tab, I still only see my camera view only (Only 1 view, even 2 connections started)

puneeth-techie commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

There's no error, But when I joined the video using another browser tab, I still only see my camera view only (Only 1 view, even 2 connections started)

@pramodya1994 Yes, exactly I am also facing the same issue. Could you please help me out if you've got any information. Even I've cloned the entire repo but, no luck..!

pisgithub commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

There's no error, But when I joined the video using another browser tab, I still only see my camera view only (Only 1 view, even 2 connections started)

This will do the trick to fire the function properly

socket.on('user-connected', userId => { console.log('New User Connected: ' + userId) const fc = () => connectToNewUser(userId, stream) timerid = setTimeout(fc, 1000 ) }) })

pisgithub commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

There's no error, But when I joined the video using another browser tab, I still only see my camera view only (Only 1 view, even 2 connections started)

@pramodya1994 Yes, exactly I am also facing the same issue. Could you please help me out if you've got any information. Even I've cloned the entire repo but, no luck..!

This will do the trick to fire the function properly

socket.on('user-connected', userId => { console.log('New User Connected: ' + userId) const fc = () => connectToNewUser(userId, stream) timerid = setTimeout(fc, 1000 ) }) })

kai525 commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

There's no error, But when I joined the video using another browser tab, I still only see my camera view only (Only 1 view, even 2 connections started)

@pramodya1994 Yes, exactly I am also facing the same issue. Could you please help me out if you've got any information. Even I've cloned the entire repo but, no luck..!

This will do the trick to fire the function properly

socket.on('user-connected', userId => { console.log('New User Connected: ' + userId) const fc = () => connectToNewUser(userId, stream) timerid = setTimeout(fc, 1000 ) }) })

idk where i'd put these codes at

GoodMan-04 commented 3 years ago

Hi, so I came across a solution for this... just do the following manipulation to the already existing code

const peer = new Peer(undefined, { host: "peerjs-server.herokuapp.com", secure: true, port: 443, });

The thread on this could be found here https://stackoverflow.com/questions/44943254/get-https-127-0-0-19000-peerjs-peerjs-idts-14993271469660-591159722513086-ne

Hope this helps! Cheers

This Works!!! Thanks

apoorv-asc commented 3 years ago

Still can't see other person connected. @AaronLazarusGomes can you help?

What is the error that you seem to be getting in the console?

There's no error, But when I joined the video using another browser tab, I still only see my camera view only (Only 1 view, even 2 connections started)

@pramodya1994 Yes, exactly I am also facing the same issue. Could you please help me out if you've got any information. Even I've cloned the entire repo but, no luck..!

This will do the trick to fire the function properly socket.on('user-connected', userId => { console.log('New User Connected: ' + userId) const fc = () => connectToNewUser(userId, stream) timerid = setTimeout(fc, 1000 ) }) })

idk where i'd put these codes at

@kai525 There's a function in script.js file starting with socket.on('user-connected',userId => somewhat around line 25

Indu-Chandana commented 3 years ago

try and replace socket.on('user-connected',(userId)=> { console.log(userId) connectToNewUser(userId,stream); }) with socket.on('user-connected', userId => { // user is joining` setTimeout(() => { // user joined connectToNewUser(userId, stream) }, 1000) })

Sumitkevlani commented 2 years ago

socket.on('user-connected', userId => { console.log('New User Connected: ' + userId) const fc = () => connectToNewUser(userId, stream) timerid = setTimeout(fc, 1000 ) }) })

this resolved the issue