IFRAME API for Directors
Enhanced IFRAME API Documentation - HTTP/WSS API Integration
Overview
The VDO.Ninja IFRAME API provides access to all HTTP/WSS API commands through the action parameter. This means you can use any command from the HTTP/WSS API directly through the iframe's postMessage interface.
Using HTTP/WSS API Commands via IFRAME
All commands available in the HTTP/WSS API can be accessed through the IFRAME API using this format:
iframe.contentWindow.postMessage({
action: "commandName",
value: "value",
value2: "optional",
target: "optional", // for director commands
cib: "callback-id" // optional callback identifier
}, "*");Director Permissions
Important: To use director commands for remote control, you must have director permissions:
Use
&director=roomnameinstead of&room=roomnamein your iframe URLOr combine with
&codirector=passwordto enable multiple directorsWithout proper permissions, director commands will fail silently
Example iframe URL with director permissions:
Complete Command Reference
Self Commands (No Target Required)
These commands affect the local VDO.Ninja instance:
Director Commands (Target Required)
These commands require director permissions and target specific guests:
Using targetGuest Function (Legacy)
The targetGuest function provides another way to control guests:
Using Commands Function
Access any command from the Commands object:
Advanced DOM Manipulation
Target specific video elements by stream ID:
Special Functions
Handling Responses
Listen for responses with callback IDs:
Complete Example: Director Control Panel
Important Notes
Director Permissions: Always use
&director=roomnameor&codirector=passwordfor director commandsTarget Format: Use slot numbers (1, 2, 3) or stream IDs for targeting
Callback IDs: Use unique
cibvalues to track responsesError Handling: Commands may fail silently without proper permissions
Timing: Wait for iframe to load before sending commands
Troubleshooting
Commands not working: Check director permissions in iframe URL
No response: Verify callback ID handling and message source
Guest not found: Confirm target value matches slot or stream ID
Permission errors: Ensure using
&director=not&room=
This integration allows you to build powerful control interfaces using the full capabilities of the VDO.Ninja API through simple iframe messaging.
Last updated
Was this helpful?