Virtual Agent

The Virtual Agent is a silent, headless web application that joins a video session as a non-publishing participant and renders the session view that is consumed by output services — HLS Streaming, RTMP Streaming, and Live Recording.

Rather than compositing video on the server directly from raw streams, EnableX loads a web-based view into a managed browser context. That rendered view becomes the single source of truth for what the audience sees in a live stream or what gets recorded. This gives you precise, pixel-level control over the output layout without any server-side rendering pipeline to configure.

Lifecycle & Sharing

The Virtual Agent operates as a shared resource across all output services running in the same session. Its lifecycle is tied to the services that depend on it:

Because the agent is shared, the streaming view URL you configure applies uniformly to all output services in the session. Design your custom view to work correctly for both live streaming and recording scenarios if you intend to use both simultaneously.
Default View vs. Custom View

Default View

EnableX provides a built-in streaming view that works without any configuration. When you start HLS streaming, RTMP streaming, or a live recording without specifying a custom view URL, the default view is used automatically.

The default view renders participants in a standard multi-tile grid layout. It is suitable for most conferencing scenarios but offers limited visual customisation.

Custom View

For full control over the streaming and recording output — custom branding, specific participant arrangements, lower-third overlays, or any bespoke layout — you can build your own streaming view and pass its hosted URL to the relevant service.

The custom view is a standard web application. It joins the video session using an EnableX token exactly as a participant would, except it does not publish any audio or video stream. It only subscribes to the room and renders the view.

Building a Custom View

Requirements

The agent runs in Headless Chrome at 1280×720 (720p). Design your entire streaming view — video tiles, overlays, lower-thirds, and any branding elements — to fit and render correctly within this fixed resolution. Do not rely on responsive breakpoints that assume larger or variable viewport sizes.

URL Scheme

Design your application to accept the EnableX token as a query string parameter. A typical URL scheme looks like this:

https://your-domain/streaming-view/?token=ENABLEX_TOKEN

When you pass this URL to a streaming or recording method, pass it without the token value — EnableX appends the generated token at runtime:

https://your-domain/streaming-view/?token=
Do not hardcode a token in the URL. Always end the URL with the token parameter name and an empty value (?token=). EnableX fills in the value when it instantiates the agent.

Joining the Session in Your View

Your streaming view application must read the token from the URL and use it to connect to the EnableX room using the Web SDK — in receive-only mode, without publishing streams:

// Read the token from the URL query string
const params  = new URLSearchParams(window.location.search);
const token   = params.get('token');

// Connect to the room — subscribe only, no publishing
const room = EnxRtc.joinRoom(token, {
  audio: false,
  video: false
}, function(response) {
  if (response.result === 0) {
    // Room joined — subscribe to remote streams and render your layout
  }
});

Passing the View URL to a Service

Once your view is hosted, pass its URL to the relevant output service. The parameter name differs by service:

Service Where to pass the URL
HLS Streaming hls_view_url in the room creation payload (Video API)
RTMP Streaming urlDetails.url in the startStreaming() config object (Video SDK)
Live Recording Custom recording view URL in the recording configuration (Video API / SDK)
Best Practices
See Also