Live Web Wk 5: WebRTC – Peer Garden!

Try it out: https://el3015.itp.io:8085/main.html

Code here: https://github.com/emilylin-itp/live-web/tree/gh-pages/wk5/wk5_peergarden

For this assignment, I focused mostly on just trying to understand how peer js and socket.io could work together. The functions I wanted to achieve were: a.) show my/users’ personal peer id, b.) be able to send the peer id of the other user via socket when the user “joins” the garden, c.) display the video stream to other user.

There are some logical mistakes in what I ended up with though. First of all, if you are the last person to join you would not see any one else’s live stream. There needs to be a way that once you join the garden you can see everyone who is in there. Not sure how I would do this exactly, but something to look into. Treated this more as socket + peerjs practice then as a project that is conceptually sound.

Questions:

  • If Peer to Peer/Web RTC is in between UDP + TCP, then what is an example of a a communication/app that is using completely UDP?
  • Followed along with the class screencast but stumbled at around 33:00 in. I got a different error message: “Error: Could not get an ID from the server. If you passed in a `path` to your self-hosted PeerServer, you’ll also need to pass in that same path when creating a new Peer.” But in my terminal I received this “id?ts = 157……” The id looks different from the screencast’s (mine only has numbers). Why?Screenshot 2019-10-06 19.35.49.png
  • Having issues with getting this “run your own peer server” to work: https://itp.nyu.edu/~sve204/liveweb_fall2019/peerserver.html
  • Why can’t I appendChild for my video into a div?
  • Why won’t the setAttribute or className(‘class name’) work on my video in the client side js?
  • Why won’t this add the class ‘ovideoStyle’?
    document.gvideoContainer.appendChild(ovideoElement, 'ovideoStyle');

References mentioned in class: 

Helpful resources: