{"id":13527382,"url":"https://github.com/node-webrtc/node-webrtc-examples","last_synced_at":"2025-06-10T14:33:30.245Z","repository":{"id":56434769,"uuid":"177716816","full_name":"node-webrtc/node-webrtc-examples","owner":"node-webrtc","description":"MediaStream and RTCDataChannel examples using node-webrtc","archived":false,"fork":false,"pushed_at":"2022-09-09T22:17:23.000Z","size":40,"stargazers_count":524,"open_issues_count":25,"forks_count":166,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-01T09:36:08.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-webrtc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T04:49:05.000Z","updated_at":"2025-03-20T06:26:40.000Z","dependencies_parsed_at":"2022-08-15T18:40:26.900Z","dependency_job_id":null,"html_url":"https://github.com/node-webrtc/node-webrtc-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webrtc%2Fnode-webrtc-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webrtc%2Fnode-webrtc-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webrtc%2Fnode-webrtc-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webrtc%2Fnode-webrtc-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-webrtc","download_url":"https://codeload.github.com/node-webrtc/node-webrtc-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webrtc%2Fnode-webrtc-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259093082,"owners_count":22804120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:46.836Z","updated_at":"2025-06-10T14:33:30.205Z","avatar_url":"https://github.com/node-webrtc.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"node-webrtc-examples\n====================\n\nThis project presents a few example applications using node-webrtc.\n\n- [audio-video-loopback](examples/audio-video-loopback): relays incoming audio\n  and video using RTCRtpTransceivers.\n- [ping-pong](examples/ping-pong): simple RTCDataChannel ping/pong example.\n- [pitch-detector](examples/pitch-detector): pitch detector implemented using\n  RTCAudioSink and RTCDataChannel.\n- [sine-wave](examples/sine-wave): generates a sine wave using RTCAudioSource;\n  frequency control implemented using RTCDataChannel.\n- [sine-wave-stereo](examples/sine-wave-stereo): generates a stereo sine wave\n  using RTCAudioSource; panning control implemented using RTCDataChannel.\n- [video-compositing](examples/video-compositing): uses RTCVideoSink,\n  [node-canvas](https://github.com/Automattic/node-canvas), and RTCVideoSource\n  to draw spinning text on top of an incoming video.\n- [record-audio-video-stream](examples/record-audio-video-stream) using [FFmpeg](https://www.ffmpeg.org) and RTCVideoSink.\n- Broadcast example with one [broadcaster](examples/broadcaster) forwarding to many [viewers](examples/viewer).\n\nUsage\n-----\n\nInstall the project's dependencies and run the tests before starting the\napplication server:\n\n```\nnpm install\nnpm test\nnpm start\n```\n\nThen, navigate to [http://localhost:3000](http://localhost:3000).\n\nArchitecture\n------------\n\nEach example application under [examples/](examples) has a Client and Server\ncomponent. RTCPeerConnection negotiation is supported via a REST API (described\nbelow), and is abstracted away from each example application. Code for\nRTCPeerConnection negotiation lives under [lib/](lib).\n\n### RTCPeerConnection Negotiation\n\nRTCPeerConnections are negotiated via REST API. The Server always offers (with\nhost candidates) and the Client always answers. In order to negotiate a new\nRTCPeerConnection, the Client first POSTs to `/connections`. The Server responds\nwith an RTCPeerConnection ID and SDP offer. Finally, the Client POSTs an SDP\nanswer to the RTCPeerConnection's URL.\n\n```\nClient                                               Server\n  |                                                     |\n  |  POST /connections                                  |\n  |                                                     |\n  |----------------------------------------------------\u003e|\n  |                                                     |\n  |                                             200 OK  |\n  |  { \"id\": \"$ID\", \"localDescription\": \"$SDP_OFFER\" }  |\n  |                                                     |\n  |\u003c----------------------------------------------------|\n  |                                                     |\n  |  POST /connections/$ID/remote-description           |\n  |  $SDP_ANSWER                                        |\n  |                                                     |\n  |----------------------------------------------------\u003e|\n  |                                                     |\n  |                                             200 OK  |\n  |                                                     |\n  |\u003c----------------------------------------------------|\n```\n\n### RTCPeerConnection Teardown\n\nRTCPeerConnections can be proactively torn down by sending a DELETE to the\nRTCPeerConnection's URL; otherwise, ICE disconnection or failure, if unresolved\nwithin the `timeToReconnect` window, will also trigger teardown. The default\n`timeToReconnect` value is 10 s.\n\n```\nClient                                               Server\n  |                                                     |\n  |  DELETE /connections/$ID                            |\n  |                                                     |\n  |----------------------------------------------------\u003e|\n  |                                                     |\n  |                                             200 OK  |\n  |                                                     |\n  |\u003c----------------------------------------------------|\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-webrtc%2Fnode-webrtc-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-webrtc%2Fnode-webrtc-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-webrtc%2Fnode-webrtc-examples/lists"}