HTTP Live Streaming is a protocol for streaming media, the easiest and most common way to organize broadcasts now.

The essence of HLS is in splitting the whole stream into small fragments (chunks), sequentially downloaded via HTTP. The flow is continuous and theoretically can be infinite. At the beginning of the session the player download a manifest (m3u8) with nested streams (with a different quality or audio track).

PlayerJS uses the latest version of the hls.js library to manage HLS, but in the settings you can choose a specific releaseHLS support is enabled by default.

Special events for JS API

You can get some HLS data through the JS API. For example, you can subscribe to fragment metadata with the fragdata event through a listener (works with version 9 of the player).

document.getElementById("player").addEventListener("fragdata", onFragmentData);

var player = new Playerjs({id:"player", file:"//site.com/stream.m3u8"});

function onFragmentData(event){

In the JS API there is also a fragment event for getting links of reproduced fragments.

DVR technology may also be relevant for HLS.

Custom hls.js

You can use your hls.js distribution, for example to implement P2P. Simply disable the HLS plugin in the builder and connect it separately with script tag on the page before connecting the player.

2019 © PlayerJS


Restore password
Sign up
Log in

Sign up free

Sign up
By signing up, you agree to Terms of Service
Login if you have an account


Your name
Order player

Restore password

Forgot email? Contact us