For more HTTP streaming examples check Stream Tester tool.
HLS protocol is managed by videojs-http-streaming (VHS) library, included in the video.js from version 7.0 by default. Unfortunately, some video.js users have trouble with playing HLS content using default video.js VHS engine. Also VHS does not support mp3 audio for HLS streams and will not allow to use the P2P Media Loader, an open source library to deliver media over Peer-toPeer network. For this reason Nuevo plugin from version 8.0 has been updated to support 3rd party HLSJS plugin based on hls.js library as an alternative for default VHS engine. This includes HLS quality picker.The original hlsjs plugin was developed by Streamroot many years ago and utilizes an old version (0.13.2) of hls.js library. Hlsjs plugin modified by Nuevodevel.com makes use of much more newer (regularly updated) version of hls.js (1.2.7) and is properly integrated with quality levels when hls stream is reinitialized with new media source, which is an issue with original hlsjs.
All you have to do is to load hlsjs.js javascript plugin right after video.js.
Code snippet
<link href="//domain.com/videojs/skins/nuevo/videojs.min.css" rel="stylesheet"><script src="//domain.com/videojs/video.min.js"></script><script src="//domain.com/videojs/plugins/hlsjs.js"></script><script src="//domain.com/videojs/nuevo.min.js"></script>Code snippet
<script>const hls_options = {"debug": true,"enableWorker": true,"lowLatencyMode": true,"backBufferLength": 90};const player = videojs('example-video', {license: "key", html5:{hlsjsConfig:hls_options}});player.nuevo({ contextMenu:false });</script>Code snippet
<script>var callback = function(videojsPlayer, hlsjs) {
hlsjs.on(Hls.Events.MANIFEST_LOADED, function(event, data) {console.log('Manifest loaded');});// do anything else};videojs.Html5Hlsjs.addHook('beforeinitialize', callback);</script>Code snippet
videojs.Html5Hlsjs.removeHook('beforeinitialize', callback);Code snippet
<script>player.ready(function(){player.hlsjs.on(Hls.Events.MANIFEST_LOADED, function (event, data) {console.log('Manifest loaded');});});</script>