GithubHelp home page GithubHelp logo

Comments (6)

dicoy-zz avatar dicoy-zz commented on May 12, 2024

Yes, just download the project on each machine and open the html file in a browser

from serverless-webrtc.

trusktr avatar trusktr commented on May 12, 2024

What are the limitations? Do they need to be on the same network? Or does this also work over internet? Any other limitations?

from serverless-webrtc.

trusktr avatar trusktr commented on May 12, 2024

How does speed compare to Web sockets for streaming data? Have you compared by chance?

from serverless-webrtc.

cjb avatar cjb commented on May 12, 2024

Why not just try it?

WebRTC datachannels are faster than websockets in the sense that WebRTC supports UDP and websockets only support TCP. So if you're building something that wants UDP-like behavior, like streaming movies or multiplayer games, you would probably prefer WebRTC.

from serverless-webrtc.

trusktr avatar trusktr commented on May 12, 2024

I just gave it a shot. I don't see where I get the "answer" from. On the first tab, I type "hello" in the box after hitting "create" server. Then it shows a box to input the "answer". Then in the second tab I hit "join", and type "hello" in the box. I don't see where to get the answer.

from serverless-webrtc.

shenzhuxi avatar shenzhuxi commented on May 12, 2024

@trusktr You need to wait a while after hitting "create" server to see the "offer text" show up in the textarea (it's not for inputting any text).

It took me a while to aware the time needed for ICE by comparing the code for browser and node.js.

pc1.onicecandidate = function (e) {
  console.log('ICE candidate (pc1)', e)
  if (e.candidate == null) {
    $('#localOffer').html(JSON.stringify(pc1.localDescription))
  }
}
  pc.onicecandidate = function(candidate) {
    // Firing this callback with a null candidate indicates that
    // trickle ICE gathering has finished, and all the candidates
    // are now present in pc.localDescription.  Waiting until now
    // to create the answer saves us from having to send offer +
    // answer + iceCandidates separately.
    if (candidate.candidate == null) {
      doShowAnswer();
    }
  }

In your case, in a closed network, you can delete iceServers from var cfg = {'iceServers': [{'url': 'stun:23.21.150.121'}]} to make offer text generation instant.

@cjb I think it will be better to update the text
"Here's your "offer" -- it tells someone else how to connect to you. Send the whole thing to them, for example in an instant message or e-mail."
into something like
"Wait your "offer" JSON text show up (It may take a while). Then copy/paste and send the text to the peer you want to connect. "

Also make the textarea read only...
Also add a waiting animation...

BTW, this project is a good example to understand WebRTC. Thanks!

from serverless-webrtc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.