HLS Streaming helps you to reach extremely large number of audiences with your video session in real time. It supports adaptive bitrate streaming to get best quality video based on available network bandwidth at receiving end.

Table of Contents


HLS Streaming helps to scale up your reach to a larger audience with your video session, meetings, webinar in real time. Audiences receive best quality video streaming based on available bandwidth at their end. A web-based Video UI may be linked to define the view of your streaming which will be played across devices.

At the background, the linked Video UI is made to join the video room automatically and a HLS Stream is created using the same view. As the Stream is ready, end points receive a HLS Stream URL to play in HLS Player.

Service Subscription

HLS Streaming Infrastructure is owned and managed by EnableX Therefore, it’s a subscription based service. Connect to Sales/Account Manager for subscription.

In case you look to livestream to YouTube, Vimeo, LinkedIn and/or Facebook; you need RTMP Live Streaming.

HLS View

HLS Streaming experience for audiences may be achieved through the Video UI presented to them. You can have a Video UI or HLS View in either of the following ways:

  • Use Default View: The simplest and quickest way is to use the default view for HLS Streaming. You needn’t code for it. It’s available with EnableX. There are limited customization option available.
  • Develop Custom View: To have a custom view, a Web-based Application needs to be developed, hosted over publicly accessible “https” URL and linked to video room. Read everything you need to know to develop custom view for your stream.

HLS Enabled Room

Even if HLS service is subscribed, the following Room Level “settings” needs to be done to have HLS Streaming in Video Session.

  • audiences: Numeric. Optional. Number of audience needed in the room. It can’t be greater than capping set at subscription. If any of the following settings are being set with room, audience count must be set to some positive number. 
  • send_audiences_stats: Boolean, true or false. Default false. Set it to true, if end-point needs to receive user-connected and user-disconnected event on entry and exit of an audience.
  • hls_view_url: String. URL. Optional. A custom view URL. If not passed, the default HLS Streaming View will be used. However, you may explicitly pass “DEFAULT” as value to this key.

Example: Room Definition JSON Payload to enable HLS Streaming.

  "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://URL-DOMAIN/PATH/?token=",
    "send_audiences_stats": true,
    "auto_recording": false,
    "quality": "SD"

Note: If HLS is not subscribed, room definition with HLS related settings is not permitted.  

Audience Token to join

A new role has been introduced for HLS Audience joining a room. It’s audience. Get a token for audience role to join a session. As soon as the first audience joins video room, HLS streaming gets initiated automatically. HLS Streaming stops when all audiences exit or disconnect from the video room.

Know how to create Token?

Example: Create Token JSON Payload for audience role

  "name": "John",
  "user_ref": "XOXO",
  "role": "audience"

HLS Player

HLS Stream URL receiving through our Video SDK event hls-started (explained later in this document) needs to be played using HLS Player. You may use your own HLS Player, or you may find one online. Use the HLS Player of your choice to play the HLS Stream URL.

However, if you look use the following HLS Player from EnableX< you can download it and use it effectively to create user user experience.

Released on: November 7, 2022

  • Method: playStreamerURI(element, hls_url) 
  • Parameters:
    • element: HTML DOM Element ID to place the HLS Player.
    • hls_url: HLS Stream URL to play in the element.

This Method is to start playing the HLS Stream URL on the given html element. Before calling this function, an object of EnxHls Class needs to be initialized to call HLS Player SDK function. 

Example: Instantiate  EnxHls

var hlsPlayer = new EnxHls(); 
	hlsPlayer.playStreamerURI("con_" + localStream.getID(), hls_url); 

Room Event Listeners

HLS Streaming starts as soon as first audience joins the video room and it stops when last audience exits/disconnects from the room. So, add listeners to the HLS related events and handle UI to create user experience.

Event Listeners:

  • hls_started: When HLS Stream gets started, it’s sent to publisher and logged in audiences. Subsequently it’s sent to new audience on room connection. It carries hls_url to play.
  • hls_stopped: When HLS Stream stops. It’s sent to the publisher when the last audience leaves video room.
  • hls_failed: When HLS Stream fails to get started or failed during ongoing streaming. It’s sent to the publisher and audiences.
  • hls_waiting: When HLS Stream initiation process is on and waiting to get started. It sent to audiences only.

Example: Listening to hls-started to play HLS Stream

room.addEventListener("hls-started", function(event) {
	var response = event.message;
	if(response.error == undefined) {
		var streaming_url =  response.hls_url;
			var hlsPlayer = new EnxHls();
			if(hlsPlayer) {
					"con_" + localStream.getID(), 
			} else {
				console.log('Error: HLS Player');
		} else {
			console.log('Error: ', error);

Error Codes

On HLS Start
7501Start HLS Streaming input parameters missing, Internal Server Error
7502Start HLS Streaming timeout, Internal Server Error
7503 Start HLS Streaming request is in process
7504Start HLS Streaming request timeout, Internal Server Error
7505HLS Streaming request is in waiting, will be started
7506HLS Streaming can’t be started now, Please try after 2 minutes
7507Start HLS Streaming input parameters missing, Internal Server
7508Start HLS Streaming input parameters missing, Internal Server Error
On HLS Stop
7520HLS Streaming request was in waiting, successfully removed the request from waiting.
7521Stop HLS Streaming failed, Internal Server Error
7522Stop HLS Streaming timeout, Internal Server Error
On HLS Waiting
7509HLS Streaming cannot be started, Internal Server Error, please try after 2 minutes
7510HLS Streaming start failed, Internal Server Error, please try after 2 minutes
7511Last HLS streaming request is in waiting
7512HLS Streaming can’t be started, please try again. Internal Server Error
7513HLS Streaming failed to start, Internal Server Error
HLS Generic Error
7000Start HLS Streaming input parameters missing, Internal Server Error