Back to Main Page

VDO.Ninja SDK Demo Gallery

Explore working examples of P2P communication patterns and features

๐Ÿš€ Running the Demos

All demos work directly in your browser - no server setup required!

For best results, open demos in multiple browser tabs or share the URL with others to test P2P connections.

Each demo includes the SDK via: <script src="../vdoninja-sdk.js"></script>

๐Ÿ“ก Core Communication

โšก Auto Connect Mesh

Minimal example that joins a room and automatically connects to peers. Sends and receives a message on connect.

Half/Full Mesh Auto View Data Channel

๐Ÿ“‹ Clipboard Sync

Share clipboard content peerโ€‘toโ€‘peer in real time across connected clients.

P2P Data Channel JSON

๐Ÿ“จ Data Channel Messaging

Comprehensive demonstration of P2P data messaging with multiple nodes, pub/sub patterns, and advanced filtering.

Tip: avoid reserved SDK types ('subscribe' | 'unsubscribe' | 'channelMessage') for custom protocols.

Multi-node Pub/Sub Filtering JSON Messages

๐Ÿ“ป Channel-Based Pub/Sub

Topic-based messaging system with channel subscriptions, perfect for chat rooms or event systems.

Channels Topics Routing

๐Ÿ”— Pure P2P Pub/Sub

Direct peer-to-peer publish/subscribe without any server relay after initial handshake.

Direct P2P No Relay Efficient

๐Ÿ“˜ Documentation

SDK API Reference

Complete list of SDK methods, helpers, aliases, and events.

Methods Events Helpers

๐ŸŽฅ Media Streaming

๐Ÿ“บ Broadcast Mode

One-to-many streaming setup with automatic viewer management and real-time statistics.

One-to-Many Live Stats Viewer Control

๐ŸŽจ Canvas & Web Audio

Stream programmatically generated content using Canvas API and Web Audio for creative applications.

Canvas API Web Audio Synthetic Media

๐Ÿ’ฌ Two-Way Video Chat

Bidirectional video/audio chat using canvas animations and tone generators.

Bidirectional Canvas Video Audio Tones

๐Ÿ”— Publisher with Scene Links

Publish video/audio and generate matching VDO.Ninja scene links with proper room hashing.

Scene Links Room Hashing Password Support

๐Ÿ“Š Stream Tracking

Monitor all streams in a room with connection states, timestamps, and waiting times.

Stream States Time Tracking Live Updates

๐ŸŽ›๏ธ Advanced Features

๐Ÿ”„ Dynamic Media Control

Add and remove audio/video tracks on the fly, demonstrating runtime media manipulation.

Dynamic Tracks Runtime Control Track Toggle

๐Ÿงฐ SDK Monitoring

Inspect connections, streams, and SDK state with live updates and controls.

Monitoring State Stats

๐ŸŽš๏ธ Track Management

Fine-grained control over individual media tracks with quality switching and constraints.

Track Control Quality Settings Constraints

๐Ÿ”ง TURN Server Config

Configure and test custom TURN servers for improved connectivity through firewalls.

TURN Config ICE Testing Connectivity

๐Ÿ”Œ Integrations

๐ŸŽฎ Discord Auto-Publisher

Chrome extension example that automatically publishes Discord video streams to VDO.Ninja.

Chrome Extension Auto-capture Discord

๐Ÿ“ค WHIP/WHEP (Standard WebRTC Streaming)

๐Ÿ“ก WHIP Publish

Publish your camera or screen to WHIP-compatible services like Twitch, Meshcast.io, or Cloudflare Stream.

WHIP Twitch Meshcast Cloudflare

๐Ÿ‘๏ธ WHEP View

Watch streams from WHEP-compatible endpoints. Connect to Meshcast.io or any WHEP server.

WHEP Meshcast Low Latency

โ„น๏ธ About WHIP/WHEP

WHIP (WebRTC-HTTP Ingestion Protocol) lets you publish media to streaming services using standard HTTP.

WHEP (WebRTC-HTTP Egress Protocol) lets you consume media from streaming services.

These are IETF standards that work independently of VDO.Ninja's P2P system.

๐Ÿงฐ Node Demos

๐Ÿ“ฆ Node.js Example

Minimal Node usage with autoโ€‘detected WebRTC. Announces a dataโ€‘only stream and logs P2P messages.

Node.js Data Channel Autoโ€‘detect

๐Ÿ—จ๏ธ Social Stream Ninja Listener

Connect to Social Stream Ninja (SSN) and receive consolidated live chat via P2P data channels.

Node.js Social Stream Data Channel

๐ŸŽถ Node Sine-Wave Publisher

Stream a generated sine tone from Node using @roamhq/wrtc's RTCAudioSource with ready-to-share scene links.

Node.js Audio RTCAudioSource

โ„น๏ธ Running Node Demos

Install dependencies: npm install ws @roamhq/wrtc (or node-datachannel).

Run examples: node demos/node-example.js or node demos/socialstreamninja-listener.js <session-id>

๐Ÿ’ก Tips for Testing

Local Testing: Open demos in multiple browser tabs or windows

Remote Testing: Share the demo URL with others - no server needed!

Debug Mode: Open browser console to see detailed connection logs

Room Names: Most demos generate random room names to avoid conflicts