antoniotrkdz / fac-workshop-materials

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FAC WebRTC Workshop

  1. Configure simple HTTPS server to serve scripts
  2. Using streams locally
    Create a
  3. Local Peer Connection and Signalling
  4. Using streams between devices over a network
  5. Building a simple remote 'Presentation' application using WebRTC

Configure HTTPS Server

This has been done for you. Please clone this repo to use the boilerplate that has been provided.

If you would like to recap how this is done, see [this description] // Put link here

Using streams locally

  • Request local media stream (video/audio)
  • Attach to browser

1. Local media streams

var promise = navigator.mediaDevices.getUserMedia({
  video: true,
  audio: true
});

promise.then((avStream) => {
  // Find my video tag...
  video = document.createElement('video');
  attachMediaStream(video, stream);
  video.play();

  // Add video tag to DOM
  videoContainer.append(v);
}).catch(() => {...})

2. Local Peer Connection

  • Connecting camera/mic to a local video tag THROUGH a peer connector
  • Implement our own local signalling
  • Shows the basic structure of how to connect streams to each other remotely without network complexity

3. Local signaling

  • Create a 'signaling' abstraction:
    • Announce (me), send (to), listen
    • Completely local

Single web page!

4. Remote Peer Connections

  • Replace local signaling with node server proxy
  • Options for transferring signaling:
    • AJAZ Poller
    • Web Socket

4. Signaling across a network

  • Split your signaling into two parts:
    • Carry information across the local network
    • Modify the application to have one end point per browser

5. Remote Presentations

  1. Announce presentation -> Presentations Server
  2. Student joins presentation
  3. Student & mentor negotiate session -> Signaling server
  4. Mentor sends A/V Real-time stream

Either using IP Cortex API or modified signaling from previous task

Signaling for Remote Presentations: Two Options

  • Evolution of simple signaling from previous example
    • Should work on a local LAN
    • Won't work across the Internet without TURN/STUN servers (complexity)
  • IP Cortex API
    • Covers all the routing across the Internet
    • More complex to configure/run

References

About


Languages

Language:JavaScript 85.0%Language:CSS 13.8%Language:HTML 1.1%