Create a React webRTC Video Chat Application Using Simple Peer

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 306

  • @CodingWithChaim
    @CodingWithChaim  4 роки тому +11

    Whats up everybody? WebRTC has been a really fun technology to play around with and make videos about. To that end, what are some webRTC videos you all would like to see me work on?

    • @benjaminikwuagwu6469
      @benjaminikwuagwu6469 4 роки тому +5

      Awesome tutorial 👍thank you. Can you do tutorial on react native on simple peer video chat group calling and live streaming?🙂

    • @mateusoliveira4538
      @mateusoliveira4538 4 роки тому

      Hi! really nice work man, thanks! I think that me and the other guys would like to see how muiltiuser video chat can be made.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Hi! I actually have a video about that already! You can see it here: ua-cam.com/video/R1sfHPwEH7A/v-deo.html

    • @TrainSimmer
      @TrainSimmer 4 роки тому

      Would be amazing to see how to implement this so it works on iOS devices. Built an entire video chat app, just to find out that iOS devices didn't like it...

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Did you build it as a mobile app or as a mobile browser based app?

  • @traveler292
    @traveler292 4 роки тому +3

    Chaim, I think you've become my new Coding Rebbe. A really great, easy-to-follow tutorial. Thank you!

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +2

      Lol I’m very happy to welcome you as my newest chusid

  • @heisdivuzki
    @heisdivuzki 4 роки тому +7

    I love the positive energy in the comment section | Nice video bro looking forward for more

  • @manoj-k
    @manoj-k 3 роки тому

    Best of all, at the superfast speed... Without anything unnecessary. Thank you

  • @sanzaydahal6760
    @sanzaydahal6760 3 роки тому +1

    Crystal Clear man, thanks a lot. Was struggling for days to grasp the core concept. Finally, everything is clear. Really appreciated. Cheers

  • @dannyzilberg3101
    @dannyzilberg3101 3 роки тому

    Hey thanks a lot! I must say, I love that you leave gaps in the code to fill. It really made me understand what's happening and also brought me into react. Great stuff!

  • @moinakhter2474
    @moinakhter2474 3 роки тому

    WOW amazing i was trying to understand simple-peer documentation but was not able to figure out properly but you mad it simple thanxxx

  • @chintaldholakia6990
    @chintaldholakia6990 4 роки тому +2

    Loved the way you explained. Also the content you choose was exact to the point (because other things were relatively simple). Great🔥

  • @saikrishnasunkam7140
    @saikrishnasunkam7140 4 роки тому +3

    This is exactly what I was looking for. Thank you!!

  • @jabirmohammad8985
    @jabirmohammad8985 4 роки тому +2

    Wow, thank you for this wonderful video. I was going implement a voice call feature in my react native app. This really helped me.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      My pleasure!

    • @lishup3975
      @lishup3975 4 роки тому

      I am also using react native to build my app. But, I am stuck at this point. I can't stream remoteVideo just by getting stream.toURL()

  • @norbertszpak4479
    @norbertszpak4479 4 роки тому +5

    super! greetings from germany; thats what i am looking for. thank you

  • @paudeldipesh
    @paudeldipesh 4 роки тому

    Very good and clear concept. I do pause the video and make some important notes. Thank you.

  • @abdelazizboudabia5044
    @abdelazizboudabia5044 4 роки тому

    Great content youre putting out there I subbed immediately. I have one question tho, does the simple-peer abstraction come with a default STUN/TURN server? Say im trying to make a p2p connection between two devices both sitting behind firewalls, would it work without the need to manually configure a STUN/TURN server?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Thank you! No for cases where there is a firewall you would need to supply your own turn server

  • @Gandolfof
    @Gandolfof 4 роки тому +2

    Thank you dude! It was nice and fast.

  • @pavel1429
    @pavel1429 4 роки тому +7

    hi! Good tutorial! Is it possible to make a video course with MERN stack to show us professional project (design patterns, folder structure etc)?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +3

      Thank you! I think that could be a great idea for a future video! Thank you for the suggestion.

    • @pavel1429
      @pavel1429 4 роки тому +2

      @@CodingWithChaim you know, there are a lot of tutorials about MERN( or even with typescrypt), but all of them are simple and similar to each other. It is difficault to find course with project written in the processional way (production code), with such features like advanced filters for e-shop, payment system, advanced animation, audio/video steams, advanced react hooks. We need a project for our future interview (if it is possible)) thank you in advance)

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      @@pavel1429 So it took me a while to come up with an idea for this video idea, but I think I have one. I think I might be able to have it live in 2 weeks time!

  • @kiranmann5794
    @kiranmann5794 2 роки тому

    Hi Chaim, great tutorial! Thanks very much. For some reason I cannot see the call id button on screen when I start another tab. I have a feeling that my browser is recognising all the tabs as one user? Tried different browsers but same issue. Any ideas?

  • @bala-st9cj
    @bala-st9cj 4 роки тому +1

    Your really great man to teach, thank u man
    Your awesome ❤

  • @serjio8781
    @serjio8781 4 роки тому +1

    This is absolutely amazing !!! I'VE SUBSCRIBED ! Could you please make a video on how to deploy all this webRTC stuff to an actual website? :)

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      You can view my deploy to Heroku and apply that stuff here.

    • @serjio8781
      @serjio8781 4 роки тому

      @@CodingWithChaim Thanks, dude. You're awesome. You deserve much more subscribers

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Thanks so much!

  • @roficakep
    @roficakep 4 роки тому +1

    nice tutorial, I hope this tutorial is more, to discuss about screen sharing, recording, and file sharing like zoom.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      These are certainly ideas I would love to explore for future videos! Thank you for the suggestions!

  • @Felipe-pb9gu
    @Felipe-pb9gu 4 роки тому +1

    Thanks for this! Im going to build a video chat app with another features all in firebase eviorment, do you think that next.js (ssr) would be a better option for this?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      you are very welcome. I think in this case there is no real reason to choose one over the other. Typically the considerations that are taken into account when choosing ssr or otherwise, are things like SEO or performance, but in this case neither are really a concern. I guess my point is, for the sake of the actual video chat, either approach is fine. If you have other considerations for your specific use case, then thats what you should look at to decide which way to go.

  • @vivamedia5958
    @vivamedia5958 3 роки тому

    Thank you for these great contents on webRTC. would you please explain a little more about STUN server and signaling server that have been used in this project? Unfortunately I don't know how to implement STUN and signaling server for simple-peer library.

  • @maleksmida2464
    @maleksmida2464 3 роки тому

    I just solved a bug in my code! thanks a lot ♥

  • @solomonogbodo4163
    @solomonogbodo4163 4 роки тому

    This is a lifesaver for me. Thanks alot

  • @ikibkilam8383
    @ikibkilam8383 4 роки тому

    Very impressive explanation, Chaim. One question, I have is that in your github code, your callPeer function defines a config object, with an iceServers array, that has credentials for TURN and STUN. However, you did not show this in the video. Does one still need to define the config object?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      For a simple local app just to mess around with you don't NEED those and at the time of recording I had not included those. A few months after the video came out I a PR from a viewer to include those and I merged it. I would say, if you wanna make a video chat production ready you would need a TURN and STUN server, but at the same time I would not rely on the those provided in this code example.

    • @ikibkilam8383
      @ikibkilam8383 4 роки тому

      @@CodingWithChaim Thank you v much. Makes sense.

  • @sriraghariharan130
    @sriraghariharan130 Рік тому

    great content.... Great explanation....❤Chaim

  • @tommy_corey
    @tommy_corey 4 роки тому

    Awesome video everything was well explained! subscribed

  • @SpreadWings7
    @SpreadWings7 3 роки тому

    I am looking for webRTC between smartphones and PC webs. The simple-peer seems to support only browsers for PC webs. I wonder if you have any other sample for them which is between phones and pc webs?

  • @iilhamriz
    @iilhamriz 2 роки тому +1

    Hi, can you make tutorial how to share screen on group video conference with reactjs and nodejs, would be awsome if you make tutorial how to make full video conference app with react js and node js, thankyou chaim

  • @Mind2learnai
    @Mind2learnai 4 роки тому +2

    Hi Chan please I am quite a newbie here, how do I make the user to be called dynamic like loading the user state in a react component and then using the user ID into the call... like user-1 calling user-N thanks

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      I am not entirely sure if I fully understand your question, but I think watching my other webrtc vide chat app might help you. In that video I demonstrate the concept of actually calling a user. Here is the link: ua-cam.com/video/BpN6ZwFjbCY/v-deo.html

    • @Mind2learnai
      @Mind2learnai 4 роки тому

      Take Skype for example. A logged in user calls another logged in user. Call is placed to a particular user

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      @@Mind2learnai Ah gotcha! Ok so I do think my other video might shed some light on that for you.

  • @maxienzenhofer7011
    @maxienzenhofer7011 4 роки тому

    Hi Chaim,
    The playlist is awesome!
    Could you please make a video about starting a simple-peer application from scratch?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +4

      I actually have a video idea where I will be building a video chat app using webrtc without simple peer from scratch. Look out for that in the next 3 weeks or so

  • @renanbritz3459
    @renanbritz3459 4 роки тому

    Hi. Great video! I'm trying to add WebRTC to React native and I don't think I'll be able to use simple-peer. Do you have any examples with RTCPeerConnection?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Hi! Glad you enjoyed the video! At the moment I dont have any examples without simple-peer, but I did find this gihub issue which may be of interest to you. github.com/feross/simple-peer/issues/109

  • @kaypakaipa8559
    @kaypakaipa8559 4 роки тому

    You are the real deal. Im Subscribed!

  • @davidtin5728
    @davidtin5728 3 роки тому

    Hi Chalm, Great video, I can make it work on chrome and both tabs are handshaking correctly. however, when I run it on Mozilla the first initiator does not seem to get back the stream from other users who has joined, and all others user who has joined can receive the stream of previous users. Not sure what's causing this to happen or if you have any idea what's causing this? thank you

  • @firewolf110998
    @firewolf110998 4 роки тому

    Hey. First of all, great video! This helped a lot! Next, this might be an easy fix but I'm new to this.
    Here is an example: A video chat room is filled with people that are streaming their camera, now an admin wants to join that room and without showing his camera but he wants to see what the other users are doing aka wants to see their faces.
    How would you do this?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      I think the simplest way I can think of doing is would be for you do add the admin to the room using the mesh network approach. You can see this in my group chat video. The difference here would be that the admin won’t be sharing and voice or video, so the others won’t see the admin or hear the admin. I would highly suggest watching the group video because that will show you how to have more than 2 peers connected at the same time

    • @firewolf110998
      @firewolf110998 4 роки тому +1

      @@CodingWithChaim Thanks! That was quick! :O I'll have a look!

  • @natalieee369
    @natalieee369 4 роки тому

    Should I need to do anything extra to deploy this to heroku? It's working fine locally but I get a polling-xhr timed out error when accessing it in heroku. I've added a procfile with a command to run the express server. And have done the same in package.json in the react scripts start command. Would you know whether Heroku works with paths from the root or does it just look into the src folder? Just in case I have the paths wrong.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      See this video to understand how to deploy an app with this sort of folder structure to heroku ua-cam.com/video/RQcWKcMa_Jc/v-deo.html

  • @yuviiiiiiiiiiiiiiiii
    @yuviiiiiiiiiiiiiiiii 4 роки тому

    Hey Chaim, your videos are great. Extremely helpful. But if you can speak a bit slower, that will be better for us viewers to comprehend and follow. Cheers!

  • @ismailhamdi5977
    @ismailhamdi5977 3 роки тому

    Hello, can i set socket id for each user so it doesnt generate a random one when ever they connect for exemple i set on each user my database socket_id column

  • @mahdisoultana4926
    @mahdisoultana4926 4 роки тому +1

    IT'S GREAT Please i have question how can i add that other users can chat with text and one with live video like live in youtube any guide please ?

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому

      Step 01: create a real-time chat (using socket.io) and video&audio stream (using webRTC and socket.io)
      Step 02: make sure to put the real-time chat and video&audio stream in the same room ( socket.join("same room") )
      Step 03: render the real-time chat and video&audio stream on the same page
      that's it best of luck mate.

    • @mahdisoultana4926
      @mahdisoultana4926 4 роки тому

      @@JJ-ci7kz ok thank you very very much i will consreve this reply as refernce

  • @leonzzonly
    @leonzzonly 4 роки тому

    Hi love your demo here, do you think this mechanism suitable for cases like streaming for education purposes? I'm trying to build an E-Classroom project here

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      webrtc can be used for such a platform, but depending on how many users you are trying to serve you may need to use some sort of peer to server setup.

    • @leonzzonly
      @leonzzonly 4 роки тому +1

      @@CodingWithChaim maybe would be serving 50 participants per calling session, I got no idea for the server part, any reference?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      Leon Chow there is something called a selective forwarding unit. I would suggest you start researching that. Unfortunately I’m still too unclear on the topic to really help. You can look into something called mediaSoup that is an open source module to solve this problem.

    • @leonzzonly
      @leonzzonly 4 роки тому +1

      @@CodingWithChaim why thanks a lot, i will look into that

  • @cesarmoran4815
    @cesarmoran4815 3 роки тому

    Hi Chaim...
    I already deployed in heroku and netlify and ist seem like is not working for devices in diferent networks

  • @dannyzilberg3101
    @dannyzilberg3101 3 роки тому

    Thanks! What's the difference between this and your other peer to peer tutorial? "Chat App Using Native WebRTC API From Scratch"?

    • @dannyzilberg3101
      @dannyzilberg3101 3 роки тому

      This video uses simple peer which is a package built around webRTC whereas in the other video he only uses webRTC. It's explained in the video

  • @soumya7430
    @soumya7430 4 роки тому

    what is the stun,turn server configuration one can use , can i just reuse what is used here if i intend to develop it for a small userbase

  • @luckycoc8395
    @luckycoc8395 3 роки тому

    Hi nice video but I have doubt if u open in 3 tabs and calling 2 user to a same user ? So how can I reject a call or simple single request accept. I have to implement peer to peer

  • @natalieee369
    @natalieee369 4 роки тому

    Hi, thanks for this video, was super useful! One issue I'm having is that the audio isn't working - you hear a screeching sound as soon as you accept a call. Have you encountered this issue before?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Hmm unfortunately I have never had this issue.

    • @craigbarratt1134
      @craigbarratt1134 4 роки тому +2

      Try with headphones. The screeching is feedback from your machines mic/speaker.

    • @himanshugarg357
      @himanshugarg357 2 роки тому

      Oh yeah. I tried and me also but if you start talking frequently it will not happen atleast in my case

  • @zouhairkhalfaoui3266
    @zouhairkhalfaoui3266 4 роки тому +1

    Hello there,
    I need a video/audio call script to implant to an excisting dating app! are you able with this ?
    thanks

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому

      it depends on what technology you use in your dating app. let's say if you used React and Express in your existing dating app then implementing the video/audio call can be easily done by just following Chaim's video tutorial. but if you used different technology I suggest checking out the documentation on how to apply webRTC on it. the process of implementing webRTC in another tech would probably be the same so watching this video will certainly help you implement video/audio call in your app.
      best of luck mate.

  • @TheMikeGoesOn
    @TheMikeGoesOn 4 роки тому

    Hi, thanks for sharing. Is this working outside the local network with according configuration changes?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      As long as the app is served over https it should work I believe.

    • @jassam246
      @jassam246 4 роки тому

      @@CodingWithChaim Will need a TURN Server for that

  • @AliRaza-iv7dt
    @AliRaza-iv7dt 2 роки тому

    if I want to send webcam and screen both using same peerConnection is it possible....

  • @ursolutions9814
    @ursolutions9814 3 роки тому

    end call is implemented brother?

  • @ooolala9296
    @ooolala9296 3 роки тому

    Hi, I tried your code, but not works on Macbook M1. I don't know what's the problem.

  • @himanshugarg357
    @himanshugarg357 2 роки тому

    Lovely. How can we add firebase google auth. How can I call a specific user. :)

  • @thesk8erdav
    @thesk8erdav 4 роки тому

    Question, if I wanted to build something like where 2 people video call, but ALSO let any arbitrary number of people stream the video call without participating, how would I implement that? Thanks

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Dav 1243 this would require some sort of peer to server setup. You may want to look into webrtc ingestion servers and media servers. The idea is you would send the stream to the server and the server would then distribute the stream out

    • @thesk8erdav
      @thesk8erdav 4 роки тому

      Coding With Chaim thank you for pointing me in the right direction! I’m looking into ant media server

  • @Imurenge-TV
    @Imurenge-TV Рік тому

    I want to learn how to design camera LAYOUT switch to when i have my guest in studio and want to switch camera view

  • @carefree_ladka
    @carefree_ladka 3 роки тому

    If I want to text as well , what do I use?

  • @rolandocaraballo
    @rolandocaraballo 4 роки тому

    How can i use thos web rtc code on my apache web server.

  • @klifffborad8377
    @klifffborad8377 4 роки тому

    Hey Chaim , thank you for the tutorial, however i want to ask , is it possible and reliable to create a rooms video conference web app (more than 40 users per room) absed on webrtc, thank you again

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      My pleasure! Yes it is possible, I actually have a video which discusses this, but in my video I use a technique called a mesh network which only allows for 4 to 6 users give or take. Making a group video chat with more than 40 users requires some more complex solutions which I am still researching. Hopefully I can have a video about that in the nearish future. Here is the group video chat video using mesh network ua-cam.com/video/R1sfHPwEH7A/v-deo.html

    • @klifffborad8377
      @klifffborad8377 4 роки тому +1

      Thank you a lot for your help

  • @KenzoArts
    @KenzoArts 4 роки тому +1

    Hello Friend, can you do Video Chat with SignalR ? I am curious to know how it will work.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      SignalR, if I understand correctly, is more of a websocket framework in the dotnet world. Websockets are not the correct tool to use for video chat. In this video I am using socket io only to facilitate the handshake between the peers, but the actual video chat is happening via webrtc. I would be happy to do a video with signalR at some point in the future, but I would like to be more clear in what your request is.

    • @KenzoArts
      @KenzoArts 4 роки тому

      @@CodingWithChaim I am just curious to know how to integrate the backend Signalr Asp.net core to manage connections between users doing video chatting.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Ok added to the list!

  • @svenbrodersen6385
    @svenbrodersen6385 4 роки тому

    Hi, is there like a part one of this video? Explaining all the socket io stuff

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      No so much a part 1 per se, but I do have a video about socket io specifically. Here is the link to this video: ua-cam.com/video/E4V6nbP_NoQ/v-deo.html

    • @svenbrodersen6385
      @svenbrodersen6385 4 роки тому

      @@CodingWithChaim Thanks man, I like your content, subscribed

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Thank you so much!

  • @murderousvortex
    @murderousvortex 4 роки тому +2

    How to solve problem with unique key prop?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Need to know more about the issue you are running into. I don’t recall iterating over a list in this video

    • @murderousvortex
      @murderousvortex 4 роки тому

      @@CodingWithChaim error on this: callPeer(key)}>Call {key} : {name} Warning: Each child in a list should have a unique "key" prop.

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому

      ​@@murderousvortex that's a react issue. you're trying to render a component dynamically and one of the requirements in rendering component dynamically in react is to put a unique key.
      e.i. ArrayOfButtons.map( item => (
      {item}
      ))

  • @JohnJanssensDeVarebeke
    @JohnJanssensDeVarebeke 4 роки тому +1

    Does anyone know if there is a "houseparty" equivalent for a corporate private event? I manage events (physical and virtual) and my clients would benefit from having a networking room. I picture something like a top shot of a room with 'live' dots representing all the registered and connected people, so that a participant can hover and tap on any other participant for a quick 1:1 video chat or round tables of up to 5-6 participants... Is there such a tool out there? Anyone technical want to tell me who could potentially develop it otherwise?

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому

      you just need to set that all up in socket.io (server side) in which you just give them rooms. the same concept on how the code in this video tutorial is implemented the only difference is that the roomId is not random and you might want to put some middleware to check if the client is allowed to enter the room to prevent some stranger entering the group/1:1 video call
      best of luck mate

  • @ilef8952
    @ilef8952 4 роки тому

    Thanks it helped me alot but i want to use my local username or user's ID not a random ids is that possible!!!

  • @vspyryt
    @vspyryt 4 роки тому

    nice video, I followed all the steps and deployed it to Heroku. It works on my LAN but when I try to call from different devices in different networks I can't get video. Any experience with that?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Getting video might depend more on the actual os/browser combo and whether it supports media devices. If you are actually able to have a proper handshake between the pairs, then its most likely not a network issue, but rather a feature availability issue. As an example, I have not been able to get video on IOS chrome.

    • @vspyryt
      @vspyryt 4 роки тому

      Interesting, I was able to make a handshake since the call and answer button work. I have two scenarios both using my app in Heroku.
      1. I make a call from two different devices connected to the same wifi network, it works.
      2. I make a call from the same two devices but from different networks this time, it doesn't work.
      Have you tried to deploy this example or any other Webrtc project?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Yea I actually deployed my group video chat app to heroku. It's a buggy mess at this point :) but it does work. Here is a link: groupvideo.herokuapp.com

    • @vspyryt
      @vspyryt 4 роки тому +1

      Nice, as expected I experienced the same problem there. I found a nice explanation here stackoverflow.com/questions/51748284/webrtc-only-works-locally-even-after-deploying-to-heroku leaving it in case someone faces the same problem. Your videos helped me a lot, keep the good work and thanks a lot for your help.

    • @karachidavid4722
      @karachidavid4722 4 роки тому

      @@CodingWithChaim please i want to deploy it p on hostgator am quite new learning by doing how do i go about deploying this to my hostgator server

  • @dimashur
    @dimashur 4 роки тому +1

    why would you advise people to write trickle: false without figuring out what it does? it stands for ICE trickle, which allows incremental gathering and connectivity checks between the peers. you should always use it

  • @RobertoSilvaZuniga
    @RobertoSilvaZuniga 4 роки тому

    Hey! you videos are amazing ;) Do you know how I and to do to create a video chat with more than one to one? for example, like a meeting chat.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      Thank you! Yes I actually have a video about that as well. ua-cam.com/video/R1sfHPwEH7A/v-deo.html

  • @agustin3186
    @agustin3186 4 роки тому

    Hi Chaim, nice video, really simple and helpful!! I am trying to use this same strategy to connect the React client (peer) to a Flutter client (peer) in a simple one-on-one connection. I could make the two peers to see each other and receive their ID's, but I don't understand how to manage the signal and how it is related to ICE Candidates which I need to manage from the Flutter end... The Flutter user receives the calling from the React user but then I cannot make the streams to start playing... Can you give me some help or at least tell me once one user called the other how ICE Candidates, Signals and Stream are related and come into play..? Thanks in advanced!!

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      The simple peer library abstracts the offer, answer and the ice-candidate exchange between peers and puts it all into the signal. If you cannot use, simple peer on the flutter side, you way just want to use the native webrtc api without simple peer. You can see this video on how to use the native webrtc api ua-cam.com/video/JhyY8LdAQHU/v-deo.html

    • @agustin3186
      @agustin3186 4 роки тому

      @@CodingWithChaim Woow, thanks!! I mean you just literally published this video today which will really help me to achieve what I need... Perfect sync!!

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      Well I certainly hope it helps you! Do let me know!

    • @agustin3186
      @agustin3186 4 роки тому

      Coding With Chaim It worked!!! I managed to make the video call between the React app and the Flutter app (using flutter_webrtc). Still have to polish it a litttle but is already working =). Do you think I need to make some changes to use it in production? For example, can I make use of the same Stun and Turn Ice Servers you used? Any other advice on the Server or the client side? Thanks!!!

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      Congrats!! I don’t know if the stun and turn servers I’m using are production. I just found them for the sake of the video.

  • @matanyemini3263
    @matanyemini3263 4 роки тому

    Great videos!!

  • @anmolsingh8660
    @anmolsingh8660 4 роки тому +1

    which do i have to run in order to see the application ??

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      in the root of the app run node server.js in the client folder yarn/npm start. Both need to be running at the same time.

    • @anmolsingh8660
      @anmolsingh8660 4 роки тому

      @@CodingWithChaim thanks but i still can't run the yarn.lock file. It is no associated application found to run this app. Could it be because i am running this setup on windows ??

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Did you install all the dependencies?

    • @anmolsingh8660
      @anmolsingh8660 4 роки тому

      Yeah the server.js is running on port 8000. But the yarn file is not running.

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому +1

      step 01: Open two terminal, one for the root (group-video-final-master/) and the other one for the client (group-video-final-master/client)
      step 02:
      in root terminal type: npm i
      in client terminal type: npm i
      *wait for the dependencies to download
      step 03:

      in root terminal type: node server.js
      in client terminal type: npm start
      *react will automatically open the website in your browser
      step 04:

      Click the create room button and you will be redirected to another page with the room in its URL. just copy the URL and paste them to another page to mimic the group video call
      * you need to allow permission to use your camera and audio. just in case you haven't allowed it
      that's it :)

  • @pjos2981
    @pjos2981 3 роки тому

    How create a login system before text chat or video chat using webrtc.

  • @sharma2029
    @sharma2029 3 роки тому

    Thank you so much😇😇

  • @genericname9199
    @genericname9199 4 роки тому

    Hi Chaim..I've having some trouble.How do I access the socket ID of a client from the socketref?When I try to console log socketref.current I can see an object with property id. But when I try to access socketref.current.id I get undefined.I have nod idea why.Can you please provide me a solution?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      That is strange indeed. Can you please share some code so that I can help you debug?

    • @genericname9199
      @genericname9199 4 роки тому

      @@CodingWithChaim thanks but I sorted it out.. It was asynchronous issue

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      Happy to hear that!

  • @danieleduardo9800
    @danieleduardo9800 4 роки тому +3

    how do I run it?????

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      You need to have 2 terminal tabs/windows open at the same time. 1 should be open to the root of the app and the second should be open to the client folder. In the root, run the command node server.js and in the client folder run yarn/npm start. They need to both be running at the same time

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому

      step 01: Open two terminal, one for the root (group-video-final-master/) and the other one for the client (group-video-final-master/client)
      step 02:
      in root terminal type: npm i
      in client terminal type: npm i
      *wait for the dependencies to download
      step 03:
      in root terminal type: node server.js
      in client terminal type: npm start
      *react will automatically open the website in your browser
      step 04: Click the create room button and you will be redirected to another page with the room in its URL. just copy the URL and paste them to another page to mimic the group video call
      * you need to allow permission to use your camera and audio. just in case you haven't allowed it
      that's it :)

  • @melanieabbet5821
    @melanieabbet5821 4 роки тому

    Hello, first I am quite a beginner but need to implement such a setup for a project so I am looking around and try things out!
    I have the same mistake as Mitchell: I get this error "Proxy error: Could not proxy request /@t from localhost:3000 to localhost:8000.
    See @t for more information (ECONNRESET).
    I read that it could be because I did not run the server before hand, However In my Terminal I cannot manage to start both is either one or the other. I have my camera on because when playing on the client npm start it display the camera view. Any idea what I did wrong or how to start both?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      You wont be able to start both process in the same terminal window, but you can open one window per process. So either have 2 terminal tabs, or 2 windows. Hope that helps!

    • @melanieabbet5821
      @melanieabbet5821 4 роки тому

      @@CodingWithChaim Oh yes that work now! Didn't realize we could do that, Thank you very much :)

  • @ravitamang2240
    @ravitamang2240 4 роки тому

    I want to destroy the peer connection on button click event , How can I approach this problem .Help would be appreciated

  • @varunpandey8117
    @varunpandey8117 3 роки тому

    I am not getting any error, when i run the program i get the message that the "server is running on port 8000", but on localhost:8000 is says Cannot GET /

    • @CodingWithChaim
      @CodingWithChaim  3 роки тому

      While the server is running, you also want to have the client side code running at the same time. In a separate terminal, go the the client folder and run the start command there

    • @varunpandey8117
      @varunpandey8117 3 роки тому

      @@CodingWithChaim yeah , i just figured that out, thank you

  • @anshulsinha6637
    @anshulsinha6637 4 роки тому +2

    Does anyone know how to make it so that you can call someone with that specific user id

  • @alimodz6253
    @alimodz6253 4 роки тому

    Great video man. I hosted server code in herko and client on netlify and it seems to work only when one of the users is using local host and other one is on the netlify website. But when both users are on website it gives this error "*index.js:17 Uncaught Error: [object RTCErrorEvent] at h (index.js:17 at RTCDataChannel._channel.onerror (index.js:490)*" . any clue? I also want to know what extension you use on vsc. And i really hate emojis XD otherwise A+ video man

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Thanks for the feedback!! I think you may need to look into including a turn server to get past firewalls issues. The way I have it setup works for dev but in a real project a turn server is needed.

    • @alimodz6253
      @alimodz6253 4 роки тому

      @@CodingWithChaimgreat man thanks.

    • @alimodz6253
      @alimodz6253 4 роки тому

      @@CodingWithChaim hey man I added the iceServers you have and it worked! I really dont understand what they are.. can I use some other username/credential/urls ??

  • @ujjwalrawat2361
    @ujjwalrawat2361 3 роки тому

    The remote stream is displaying in microsoft edge but not in google chrome can anyone tell me why it is so...?

  • @Einherjar02
    @Einherjar02 4 роки тому

    Hello do you think it is easy to make a WHITEBOARD interactive in WEBRTC ? Many user can Write with the mouse many think. ( like teachers and students )

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Assuming this would work without video then a simple mesh network would do the trick for something like your idea. If however teacher and students would also have video of each other it gets more complicated

    • @Einherjar02
      @Einherjar02 4 роки тому

      @@CodingWithChaim so it is better to use WEBSOCKET ?
      I believed "writing in a whiteboard" using canvas and JSON transfert the coord of the mouse of each one and "draw" ?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      I think for the sake of sharing the data of what’s on the board both sockets and webrtc are both fine options. The way I see it, choosing between the 2 comes down fo latency. WebRTC is faster so if that it something you need go with that. Again if it’s just for the board and no video then webRTC solution won’t be too complicated

  • @kavitagoyal928
    @kavitagoyal928 4 роки тому

    What i have to write in my terminal

  • @СавваКашин-ш2ж
    @СавваКашин-ш2ж 4 роки тому

    Hi, can i theoretically do it on vue.js?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      All the concepts would still be the same, its only the react specific bits that would be different.

    • @СавваКашин-ш2ж
      @СавваКашин-ш2ж 4 роки тому

      ​@@CodingWithChaim Thanks for the answer, but I have a couple of questions. Is there any analogue of useState in the vue, that is, at the beginning of App.js there are many variables, how can I designate them in the vue. And I wonder what to do with useRef, because there are no dynamic useRefs in the vue, thanks in advance for your answer.
      And sorry for my egnlish, im from Russia)

  • @profesoran2371
    @profesoran2371 4 роки тому

    thanks bro! like this video can one go live on a file and users when go in that file see the video live of that person
    sorry my English is not very good but i hope you know what i mean

  • @cancer10in
    @cancer10in 4 роки тому

    Thanks for sharing this.
    I cloned your github and ran npm install for both server and client, I am getting an error in the console when I accept the caller, any idea how to resolve it?
    PS: I am using Chrome browser Version 80.0.3987.163 (Official Build) (64-bit) and node v12.4.0
    "Uncaught Error: Connection failed.
    at makeError (index.js:17)
    at Peer._onConnectionStateChange (index.js:654)
    at RTCPeerConnection.Peer._pc.onconnectionstatechange"

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Unfortunately I do not know why you are getting this error. If you cloned my complete code and made no changes it should work right out of the box. If you did make changes however, I would be happy to review your code and see if there is a mistake perhaps.

    • @cancer10in
      @cancer10in 4 роки тому

      ​@@CodingWithChaim Thanks for replying, I did not change anything in your code. However when I run it in firefox I get the following error in console. any clue?
      "ICE failed, add a TURN server and see about:webrtc for more details"
      "Error: Ice connection failed."
      Screenshot:
      prnt.sc/rtblrl

    • @cancer10in
      @cancer10in 4 роки тому

      Alright i figured that my macos firewall was blocking the connection, it started working as soon as I turned the firewall off. How can I make it work even if the firewall is turned on? because it will not be a good experience if we tell our customers/clients to turn off the firewall. Just like when using zoom it still works with firewall turned on. Pls advise.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      Off the top of my head I actually don’t know how to solve that problem. Should be interesting to investigate this actually!

    • @kientrung2274
      @kientrung2274 4 роки тому

      As my view you need TURN server to resolve firewall issue, please google it and share the result if it works

  • @wassim5622
    @wassim5622 4 роки тому

    Great vid !! Keep it uuup

  • @Aakash-mi8xq
    @Aakash-mi8xq 3 роки тому

    how to remove the video of the user that has left the room. Please suggest a way

  • @learnmaziyyah473
    @learnmaziyyah473 4 роки тому

    Amazing Content

  • @mcotechtv4180
    @mcotechtv4180 4 роки тому

    i need more basic like how to create those starter files like very basic please help

  • @karachidavid4722
    @karachidavid4722 4 роки тому

    hello thanks for this but when i try to run yarn start it tells me cannot find module express what do i do please

    • @karachidavid4722
      @karachidavid4722 4 роки тому

      ok ive solved this issue but please am a beginner how do i go about running this

    • @JJ-ci7kz
      @JJ-ci7kz 4 роки тому

      step 01: Open two terminal, one for the root (group-video-final-master/) and the other one for the client (group-video-final-master/client)
      step 02:
      in root terminal type: npm i
      in client terminal type: npm i
      *wait for the dependencies to download
      step 03:

      in root terminal type: node server.js
      in client terminal type: npm start
      *react will automatically open the website in your browser
      step 04:

      Click the create room button and you will be redirected to another page with the room in its URL. just copy the URL and paste them to another page to mimic the group video call
      * you need to allow permission to use your camera and audio. just in case you haven't allowed it
      that's it :)
      also if you're a beginner don't learn things like this just yet. start at learning the basics first before jumping to this topic.

    • @karachidavid4722
      @karachidavid4722 4 роки тому

      @@JJ-ci7kz oh thanks for reply but ive actually done this about a month ago. but i didint see any create room button i only saw a call button with a key after opening the url in another browser . would really want sometn like what u explained where i see a button then click it to get a key before calling . also if i wanna run this in hostgator how do i host it thanks

  • @afsankhan5740
    @afsankhan5740 4 роки тому

    Sir I want to save that video of 4-4 sec and later combine that video to make a complete videos
    .is that possible?

  • @andrewsimonds8730
    @andrewsimonds8730 4 роки тому

    Does anyone know how to handle ending the call and starting the call again?

  • @0xmrwzrd
    @0xmrwzrd 4 роки тому

    Hey quick question, I downloaded the starter code and ran npm install on both the client and the server. when I try to run npm start on the client I get this error "Proxy error: Could not proxy request /socket.io/?EIO=3&transport=polling&t=N5rmc4h&sid=TOiO0D0_iqgpJda2AAAA from localhost:3000 to localhost:8000.
    See nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
    "

    • @0xmrwzrd
      @0xmrwzrd 4 роки тому

      Any idea why this is happening?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      My only guess would be that you have the client code running but not the sever code. In the server code you would need to run node server.js so that the client has who to proxy to.

    • @0xmrwzrd
      @0xmrwzrd 4 роки тому

      Coding With Chaim that’s strange I do have the server code running as well

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      In that case I would say you possibly starter the client before the server which is why you have this error. If both servers are currently running, you should be good to go. Please do let me know if the problem remains.

    • @0xmrwzrd
      @0xmrwzrd 4 роки тому

      @@CodingWithChaim Yep the error is still there unfortunately, I just sent an email!

  • @fugeeohu9357
    @fugeeohu9357 3 роки тому

    The other users have to be in the room first to be listed for calling because they're going to be identified by their userID that was created when they visited the url So then how would this work with real users? How do you get them in the room first? Anyone please

  • @dhairyawadhwani3121
    @dhairyawadhwani3121 4 роки тому

    How many maximum user we can add using this code. Is there any limit for no. of user calling at the same time.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      In this example, only 2 peers can call each other at any one point in time. You can have many 1 on 1 conversations, but each video chat can only be between 2 people using this example. I have another video where I demonstrate how to make a group video chat. In that example, you can have up to 6 max people in one group chat. Here is the link ua-cam.com/video/R1sfHPwEH7A/v-deo.html

    • @dhairyawadhwani3121
      @dhairyawadhwani3121 4 роки тому

      @@CodingWithChaim Oh that's great! Thanxx

  • @pesovatech6899
    @pesovatech6899 2 роки тому

    mehn I had to reduce the speed to 0.75 lol, nice video

  • @PraveenKumar-fd1sn
    @PraveenKumar-fd1sn 4 роки тому

    How to mute and unmute our video or audio when we click our video screen ?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      You can look into the addStream and removeStream methods that simple-peer offers.

  • @oktaymeyt
    @oktaymeyt 4 роки тому

    Hey Chaim, can I do this with only voice and no video? if so, how?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +2

      Yes you absolutely can! The only thing that would change in the code would be to not request the browser for the video stream, but only for the audio stream. It would look something like this
      navigator.mediaDevices.getUserMedia({ audio: true })
      In this snippet we are only asking the browser for the audio and not the video. That is the only change needed.

    • @oktaymeyt
      @oktaymeyt 4 роки тому

      @@CodingWithChaim I had that in mind but thought it may break the app. Thank you very much Chaim! Great vid

  • @hincha013
    @hincha013 4 роки тому

    I've a question, can I replicate this tutorial with React Native ?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      I myself have never tried this, but so far as I can tell there should be no reason why this would not work. If you do try this, please do report back with how it went.

    • @tijsmartens9458
      @tijsmartens9458 4 роки тому

      I don't think this will work in with rn tbh. the navigator.mediadevices is something that does not exist for example... you can get it to work, but the code will be pretty different i think.

  • @rahulbhingardive1458
    @rahulbhingardive1458 4 роки тому

    Hi
    Amazing video tutorial
    Can you please help me setup or get my one TURN +STUN server credentials .

  • @6365bharath
    @6365bharath 4 роки тому

    If I disconnect a call and call again I run into this error. How do I avoid this?
    cannot signal after peer is destroyed

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      The way I wrote the code was mostly for demonstration and not fully ironed out. In reality when a call ends, the peers should be cleaned up, and each new call should create a brand new peer. I believe this may be the cause of your issue.

    • @6365bharath
      @6365bharath 4 роки тому

      ​@@CodingWithChaim So both the initiator peer and the other peer must be set again. But isn't that happening by default when acceptCall() function is called.

  • @pramodyamendis3887
    @pramodyamendis3887 3 роки тому

    Anyone know how to run this code in localhost?

  • @oktaymeyt
    @oktaymeyt 4 роки тому

    Hey Chaim,
    When I run npm start on Client part, my avast warns me about IDP.HELU.PSE19. Is this normal?

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому

      I am unfortunately not familiar with this error or warning. I have never seen it before. Sorry

  • @jerrylai9775
    @jerrylai9775 4 роки тому

    Hi I clone the repository but it didnt work, it only shows one screen with no buttons even tho I open two tabs.

    • @CodingWithChaim
      @CodingWithChaim  4 роки тому +1

      You need to make sure you have the backend and the client side servers running at the same time. In the root of the app run node server.js and at the same time run npm start in the client folder

    • @jerrylai9775
      @jerrylai9775 4 роки тому

      Coding With Chaim I ran my server on port 8000 and ran npm start in the client folder but it only shows one user no call options

    • @chrystalmingo8216
      @chrystalmingo8216 3 роки тому

      @@jerrylai9775 Hi were you ever able to solve this issue? I'm having the same problem