Embedding (iframe, WebView)
Address parameters
Section titled “Address parameters”https://visio.example.org/room/<room>?pseudo=Alix&embed=1&autoJoin=1&theme=dark#k=<key>| Parameter | Purpose | Values |
|---|---|---|
pseudo |
Display name. | text |
embed |
Embedded mode, without header or extra elements. | 1 or 0 |
autoJoin |
Join directly, without the lobby (the name must be provided). | 1 or 0 |
theme |
Theme. | light (default) or dark |
bridgeName |
Name of the JavaScript channel on the host app side. | default: MilitantVisio |
#k= |
Chat key (43 base64url characters, 256 bits). | generated by the browser |
For everyone embedded to read the same chat, the host app must give them the same #k=. Generate 32 random bytes on the client (crypto.getRandomValues), encode them as base64url without =, and never send this key to your own server if you want to keep end-to-end encryption. Without #k=, each person gets a different key.
Events sent to the host app
Section titled “Events sent to the host app”Each event is an object { type, roomId, ...data }. It is sent through window.parent.postMessage (iframe), the bridgeName channel, FlutterPostMessage, Android, and webkit.messageHandlers[bridgeName] (iOS).
type |
When | Data |
|---|---|---|
militant-visio-connected |
Connected to the room. | roomId |
militant-visio-disconnected |
Connection lost. | roomId |
militant-visio-state |
Local state changed. | userCount, isConnected, isVideoOn, isAudioOn, handRaised |
militant-visio-leave |
The person leaves the room. | roomId |
militant-visio-error |
Error. | message |
Host page example:
<iframe id="visio" allow="camera; microphone; display-capture; autoplay" src="https://visio.example.org/room/assembly?pseudo=Alix&embed=1&autoJoin=1#k=..."></iframe><script> window.addEventListener('message', (event) => { if (event.origin !== 'https://visio.example.org') return; if (event.data?.type === 'militant-visio-leave') { document.getElementById('visio').remove(); } });</script>The allow="camera; microphone; display-capture; autoplay" attribute is required: without it, the browser blocks camera, microphone and screen sharing inside the iframe.