HLS Streaming
HLS (HTTP Live Streaming) lets you broadcast an ongoing EnableX video session to a large audience in real time. Unlike RTMP, which pushes a stream to an external CDN, HLS is managed entirely by EnableX — the infrastructure scales to handle large viewer counts, and adaptive bitrate ensures the best playback quality across varying network conditions.
Typical use cases include webinars, virtual conferences, live classes, concerts, and corporate town halls where a moderator-driven session needs to reach a large number of read-only viewers simultaneously.
A web-based Video UI is linked to the video room as the HLS streaming view. At the back end, EnableX automatically joins this view into the video session — without publishing any stream — and uses its rendered output to generate the HLS feed. When the HLS stream is ready, each connected audience member receives an HLS Stream URL to play in any compatible HLS player.
- HLS streaming starts automatically when the first audience member joins the room.
- HLS streaming stops automatically when the last audience member exits or disconnects.
- New audience members who join mid-session immediately receive the current stream URL.
The HLS feed is rendered from a web-based UI that joins the video room silently. You can use the built-in view or provide your own.
Default View
EnableX provides a ready-made default HLS view that requires no code. To use it, simply omit
hls_view_url from the room settings, or explicitly pass "DEFAULT"
as its value. The default view provides a standard multi-party tile layout and limited
customisation options.
Custom View
For a branded or purpose-built layout, you can develop a web application, host it on an HTTPS
URL, and pass that URL as hls_view_url in the room settings. The custom view
must be able to join the video session using an EnableX token without publishing any
audio or video stream.
For step-by-step guidance on building a custom streaming view, see Virtual Agent — Custom Streaming View.
To enable HLS streaming in a video room, include HLS-specific settings in the room creation payload sent to the Video API.
Room Settings
| Setting | Type | Description |
|---|---|---|
audiences |
Number | Maximum number of HLS audience slots. Must not exceed the cap defined in your subscription. Must be a positive number when any other HLS setting is specified. |
send_audiences_stats |
Boolean | Default false. Set to true to receive user-connected and user-disconnected events when audience members join or leave the room. |
hls_view_url |
String (URL) | The URL of your custom HLS streaming view. If omitted, or if you pass "DEFAULT", the EnableX default view is used. |
Example room creation payload with HLS streaming enabled:
{
"name": "HLS Trial",
"owner_ref": "XOXO",
"settings": {
"description": "HLS Trial",
"mode": "group",
"scheduled": false,
"adhoc": false,
"duration": 30,
"moderators": "1",
"participants": "2",
"audiences": 6,
"hls_view_url": "https://your-domain/hls-view/?token=",
"send_audiences_stats": true,
"auto_recording": false,
"quality": "SD"
}
}
hls_view_url without an actual token value. EnableX
appends the generated token at runtime. Use a trailing ?token= or
&token= at the end of the URL.
Audience Token
HLS audience members join using the audience role. Generate a token for each
audience member using the Video API with the following
payload:
{
"name": "John",
"user_ref": "XOXO",
"role": "audience"
}
Audience members do not publish audio or video and do not appear in the moderator's participant panel. They receive the HLS stream URL via an SDK event once the stream is active. Use any HLS-compatible player to play the stream URL — either your own or a third-party player.
HLS Player
The HLS stream URL is delivered to audience members through a room event, callback, or delegate method — depending on the platform SDK in use. Refer to the relevant SDK page for the exact event name and payload:
EnableX sends four HLS-related notifications to connected endpoints. Handling these events lets you update the UI appropriately — for example, showing a "Stream is starting…" message while waiting, or displaying the player once the stream is live.
| Event | Sent To | Description |
|---|---|---|
| HLS Start | Publisher & all connected audiences | Fired when the HLS stream becomes active. Carries the hls_url to play. Also sent to new audience members when they join mid-stream. |
| HLS Stop | Publisher | Fired when the HLS stream stops — typically when the last audience member leaves the room. |
| HLS Failure | Publisher & audiences | Fired when the HLS stream fails to start or encounters an error during an active stream. |
| HLS Waiting | Audiences only | Fired when the HLS stream initiation process is underway. The audience member should wait before attempting to play. |
Error codes are delivered to endpoints alongside the corresponding HLS event. Use these to display meaningful messages or trigger retry logic in your application.
On HLS Start
| Code | Description |
|---|---|
7501 | Input parameters to start HLS streaming are missing (internal server error). |
7502 | HLS streaming timeout has been initiated (internal server error). |
7503 | Request to start HLS streaming is currently being processed. |
7504 | Request to start HLS streaming has timed out (internal server error). |
7505 | HLS streaming request is queued and will start shortly. |
7506 | HLS streaming cannot start right now. Try again after 2 minutes. |
7507 | Input parameters to start HLS streaming are missing (internal server error). |
7508 | Input parameters to start HLS streaming are missing (internal server error). |
On HLS Stop
| Code | Description |
|---|---|
7520 | A queued HLS streaming request encountered an error before starting and has been removed from the queue. |
7521 | Failed to stop HLS streaming (internal server error). |
7522 | HLS streaming timeout was stopped (internal server error). |
On HLS Waiting
| Code | Description |
|---|---|
7509 | HLS streaming cannot start due to an internal error. Try again after 2 minutes. |
7510 | Failed to start HLS streaming (internal server error). Try again after 2 minutes. |
7511 | The last HLS streaming request is still in the waiting queue. |
7512 | HLS streaming cannot start due to an internal error. Try again. |
7513 | Failed to start HLS streaming (internal server error). |
Generic Error
| Code | Description |
|---|---|
7000 | Input parameters to start HLS streaming are missing (internal server error). |