IFRAME API Basics
Understanding the VDO.Ninja IFRAME API: Detecting User Joins and Disconnects
How the IFRAME API Works
Setting Up the Basic Structure
// Create the iframe element
var iframe = document.createElement("iframe");
// Set necessary permissions
iframe.allow = "camera;microphone;fullscreen;display-capture;autoplay;";
// Set the source URL (your VDO.Ninja room)
iframe.src = "https://vdo.ninja/?room=your-room-name&cleanoutput";
// Add the iframe to your page
document.getElementById("container").appendChild(iframe);Setting Up the Event Listener
Detecting User Joins and Disconnects
Guest Connections
Disconnections
Complete Working Example
Waiting Room Example
Getting Additional Information About Connections
Best Practices
VDO.Ninja IFRAME API - Complete Inbound Control Reference
Table of Contents
Basic Usage
Audio Controls
mic - Microphone Control
mic - Microphone Controlmute / speaker - Speaker Control
mute / speaker - Speaker Controlvolume - Volume Control
volume - Volume Controlpanning - Audio Panning
panning - Audio PanningtargetAudioBitrate - Audio Bitrate Target
targetAudioBitrate - Audio Bitrate Targetaudiobitrate - Audio Bitrate Control
audiobitrate - Audio Bitrate ControlPPT - Push-to-Talk
PPT - Push-to-TalkVideo Controls
camera - Camera Control
camera - Camera Controlpauseinvisible - Pause Invisible Videos
pauseinvisible - Pause Invisible Videoskeyframe - Request Keyframe
keyframe - Request KeyframeStream Management
requestStream - Request Specific Stream
requestStream - Request Specific Streamclose / hangup - Disconnect Streams
close / hangup - Disconnect StreamsRecording Controls
record - Local Recording Control
record - Local Recording ControlGroup Management
groups - Set Groups
groups - Set GroupsgroupView - Set View Groups
groupView - Set View GroupsBitrate & Quality Controls
bitrate - Video Bitrate Control
bitrate - Video Bitrate ControltargetBitrate - Target Video Bitrate
targetBitrate - Target Video BitratemanualBitrate - Manual Bandwidth Control
manualBitrate - Manual Bandwidth Controlscale - Resolution Scaling
scale - Resolution ScalingtargetWidth / targetHeight - Resolution Request
targetWidth / targetHeight - Resolution RequestDevice Management
changeVideoDevice - Change Camera
changeVideoDevice - Change CamerachangeAudioDevice - Change Microphone
changeAudioDevice - Change MicrophonechangeAudioOutputDevice - Change Speaker
changeAudioOutputDevice - Change SpeakergetDeviceList - List Available Devices
getDeviceList - List Available DevicesLayout & Display Controls
layout - Set Layout
layout - Set LayoutpreviewMode - Switch Preview Mode
previewMode - Switch Preview Modeslotmode - Slot Mode Control
slotmode - Slot Mode ControladvancedMode - Toggle Advanced UI
advancedMode - Toggle Advanced UItoggleSettings - Toggle Settings Panel
toggleSettings - Toggle Settings Paneltarget - DOM Manipulation
target - DOM ManipulationData & Messaging
sendData - Send Generic Data
sendData - Send Generic DatasendChat - Send Chat Message
sendChat - Send Chat MessagesendMessage - WebRTC Message to Viewers
sendMessage - WebRTC Message to ViewerssendRequest - WebRTC Request to Publishers
sendRequest - WebRTC Request to PublisherssendPeers - Message All Peers
sendPeers - Message All PeerssendRawMIDI - Send MIDI Data
sendRawMIDI - Send MIDI DataStatistics & Monitoring
getStats - Get Quick Stats
getStats - Get Quick StatsgetFreshStats - Get Detailed Stats
getFreshStats - Get Detailed StatsgetRemoteStats - Request Remote Stats
getRemoteStats - Request Remote StatsrequestStatsContinuous - Continuous Stats
requestStatsContinuous - Continuous StatsgetLoudness - Audio Loudness Monitoring
getLoudness - Audio Loudness MonitoringgetStreamIDs - List Stream IDs
getStreamIDs - List Stream IDsgetStreamInfo - Detailed Stream Information
getStreamInfo - Detailed Stream InformationgetDetailedState - Complete State Information
getDetailedState - Complete State InformationgetGuestList - Get Guest List
getGuestList - Get Guest ListUtility Functions
reload - Reload Page
reload - Reload Pagestyle - Inject Custom CSS
style - Inject Custom CSSfunction - Execute Built-in Functions
function - Execute Built-in FunctionssaveVideoFrameToDisk - Save Screenshot
saveVideoFrameToDisk - Save ScreenshotgetVideoFrame - Get Video Frame Data
getVideoFrame - Get Video Frame DatacopyVideoFrameToClipboard - Copy Screenshot
copyVideoFrameToClipboard - Copy ScreenshotgetSnapshotBySlot / getSnapshotByStreamID - Get Slot/Stream Snapshot
getSnapshotBySlot / getSnapshotByStreamID - Get Slot/Stream SnapshotAdvanced Controls
sceneState - OBS Scene State
sceneState - OBS Scene Statelayouts - OBS Layout Sync
layouts - OBS Layout SyncobsCommand - OBS Commands
obsCommand - OBS CommandssetBufferDelay - Audio/Video Buffer Delay
setBufferDelay - Audio/Video Buffer Delayautomixer - Automixer Control
automixer - Automixer ControlenableYouTube - YouTube Chat Integration
enableYouTube - YouTube Chat IntegrationnextSlide / prevSlide - Slide Navigation
nextSlide / prevSlide - Slide NavigationgetFaces / faceTrack - Face Detection
getFaces / faceTrack - Face DetectiongetEffectsData - Effects Data
getEffectsData - Effects Dataaction - Companion API Actions
action - Companion API ActionsResponse Handling
Notes
Last updated
Was this helpful?