GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - node-webrtc/node-webrtc-examples: MediaStream and RTCDataChannel examples using node-webrtc

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
html
html
 
 
lib
lib
 
 
test
test
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

node-webrtc-examples

This project presents a few example applications using node-webrtc.

  • audio-video-loopback: relays incoming audio and video using RTCRtpTransceivers.
  • ping-pong: simple RTCDataChannel ping/pong example.
  • pitch-detector: pitch detector implemented using RTCAudioSink and RTCDataChannel.
  • sine-wave: generates a sine wave using RTCAudioSource; frequency control implemented using RTCDataChannel.
  • sine-wave-stereo: generates a stereo sine wave using RTCAudioSource; panning control implemented using RTCDataChannel.
  • video-compositing: uses RTCVideoSink, node-canvas, and RTCVideoSource to draw spinning text on top of an incoming video.
  • record-audio-video-stream using FFmpeg and RTCVideoSink.
  • Broadcast example with one broadcaster forwarding to many viewers.

Usage

Install the project's dependencies and run the tests before starting the application server:

npm install
npm test
npm start

Then, navigate to http://localhost:3000.

Architecture

Each example application under examples/ has a Client and Server component. RTCPeerConnection negotiation is supported via a REST API (described below), and is abstracted away from each example application. Code for RTCPeerConnection negotiation lives under lib/.

RTCPeerConnection Negotiation

RTCPeerConnections are negotiated via REST API. The Server always offers (with host candidates) and the Client always answers. In order to negotiate a new RTCPeerConnection, the Client first POSTs to /connections. The Server responds with an RTCPeerConnection ID and SDP offer. Finally, the Client POSTs an SDP answer to the RTCPeerConnection's URL.

Client                                               Server
  |                                                     |
  |  POST /connections                                  |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |  { "id": "$ID", "localDescription": "$SDP_OFFER" }  |
  |                                                     |
  |<----------------------------------------------------|
  |                                                     |
  |  POST /connections/$ID/remote-description           |
  |  $SDP_ANSWER                                        |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |                                                     |
  |<----------------------------------------------------|

RTCPeerConnection Teardown

RTCPeerConnections can be proactively torn down by sending a DELETE to the RTCPeerConnection's URL; otherwise, ICE disconnection or failure, if unresolved within the timeToReconnect window, will also trigger teardown. The default timeToReconnect value is 10 s.

Client                                               Server
  |                                                     |
  |  DELETE /connections/$ID                            |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |                                                     |
  |<----------------------------------------------------|

About

MediaStream and RTCDataChannel examples using node-webrtc

Resources

Readme
Activity
Custom properties

Stars

544 stars

Watchers

24 watching

Forks

162 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.