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

🧰 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

ℹ️ 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