WebDevSimplified / Zoom-Clone-With-WebRTC

1.52k stars 863 forks source link

video error #54

Closed avinashboy closed 3 years ago

avinashboy commented 3 years ago

Screenshot 2021-03-09 123340

avinashboy commented 3 years ago

here is the repository https://github.com/avinashboy/video-chat. please tell me what is the error? I can't find it and here is the link of the site https://baby-kill.herokuapp.com/

Mike-7777777 commented 3 years ago

i cant reproduce this bug in my chrome browser, everything seems works properly.

avinashboy commented 3 years ago

i cant reproduce this bug in my chrome browser, everything seems works properly.

try with your phone and web browser.

Mike-7777777 commented 3 years ago

i cant reproduce this bug in my chrome browser, everything seems works properly.

try with your phone and web browser.

Hi, I do reproduced this error when I use two devices in diff network environment. Use TURN server could solve this problem through my experience.

Some pairs of peers in the world is hided behind NAT, so you need use STUN server to do NAT traversal. If you have a symmetric NAT(the worst case), which is impossible to find a method to connect two peers directly, you even need a TURN server to relay the data(not P2P at all).

You can use coTurn in GitHub, and build your STUN & TURN server quickly. Hope this information is helpful.

avinashboy commented 3 years ago

hey Mike-7777777 did u know about RSA using with js

avinashboy commented 3 years ago

i cant reproduce this bug in my chrome browser, everything seems works properly.

try with your phone and web browser.

Hi, I do reproduced this error when I use two devices in diff network environment. Use TURN server could solve this problem through my experience.

Some pairs of peers in the world is hided behind NAT, so you need use STUN server to do NAT traversal. If you have a symmetric NAT(the worst case), which is impossible to find a method to connect two peers directly, you even need a TURN server to relay the data(not P2P at all).

You can use coTurn in GitHub, and build your STUN & TURN server quickly. Hope this information is helpful.

Could you show me some documentation how to use and how to connect group of people in same call like that

Mike-7777777 commented 3 years ago

@avinashboy Basically, you just need to install coTurn to your server (tons of tutorials about it are online), or you can just use existing public turn servers, and add one more parameter when you launch the Peer object in js(u can check my repository btw).

List of public stun servers

const myPeer = new Peer(undefined, { config: { iceServers: [ { url: "turn:stun.****.com:****", username: "****", credential: "****", }, ], }, host: "/", port: "", secure: true, });

avinashboy commented 3 years ago

image

I get this error. I change this part const myPeer = new Peer(undefined, { config: { iceServers: [ { url: "turn:stun..com:", username: "", credential: "", }, ], }, host: "/", port: "", secure: true, });

How can I get a username and credential?

borborich commented 3 years ago

@avinashboy i see same error in default project

avinashboy commented 3 years ago

Seriously I don't get it....in youtube tutorial working fine but when we try by ourself it not working at all....😞😓

Mike-7777777 commented 3 years ago

This project looks great in utube tutorial because author's phones and chrome pages are P2Pable. It didn't do anything about ICE(Interactive Connectivity Establishment), which needs stun and turn servers.

In network, to find p2p connection is not easy in all cases. In some cases, you just lucky enough to build p2p connection perfectly. In other cases, you may need stun to find the way to build p2p connection. If you are super unlucky, stun is not working, you are facing a symmetric NAT. It is very hard to make p2p connection when both sides of users are using symmetric NAT, so you need a central server do relay, which is turn server.

idk if I make it clear, but if u rly wanna make it work, you need

  1. buy one or more server(s).
  2. make it a signal server.
  3. buy one or two(optional) domain name, and bind your domain name and server IP address.
  4. make it a coTurn server by tutorial.
  5. remember the username and password that you stored in configuration file of coTurn.
  6. use Peer-js and put the username & password in 'username' & 'credential'.
  7. test and fix.

IMPORTANT!!! These steps is for projects that work well when peers(users) in the same network(using same wifi).

Since I think I have provided enough information so that people can solve the problems mentioned in this issue, I will most likely not reply again.

avinashboy commented 3 years ago

Thank you Mike-7777777