Videojs HLS Streaming Test

For more HTTP streaming examples check Stream Tester tool.

VideoJs player with Nuevo theme and plugin HLS streaming tests

HTTP Live Streaming (HLS) has become a de-facto standard for streaming video on desktop and on mobile devices thanks to its native support on iOS and Android.
Video example above is HLS adaptive bitrate streaming based on m3u8 manifest file. Nuevo plugin for videojs has built in HLS stream quality selector. Quality button appears automatically if only m3u8 playlist includes information about resolution variants.
Resolution picker does not work on iOS devices, since iOS allows only native HLS streaming and is outside of control. Resolution picker by Nuevodevel allows to switch into any static resolution available and back to Auto mode. In Auto mode it allows to see resolution changes in real time when player is resized (eg. to fullscreen) or internet speed chnages significantly.

videojs HLS streaming supports a bunch of HLS features. Here are some highlights:
  • video-on-demand and live playback modes.
  • backup or redundant streams.
  • mid-segment quality switching.
  • AES-128 segment encryption.
  • CEA-608 captions are automatically translated into standard HTML5 caption text tracks.
  • Timed ID3 Metadata is automatically translated into HTML5 metedata text tracks.
  • Highly customizable adaptive bitrate selection.
  • Automatic bandwidth tracking.
  • Cross-domain credentials support with CORS.
  • Tight integration with video.js and a philosophy of exposing as much as possible with standard HTML APIs.
  • Stream with multiple audio tracks and switching to those audio tracks.
  • Media content in fragmented MP4s instead of the MPEG2-TS container format.
Code snippet

<script type=text/javascript" src="//domain.com/videojs/video.min.js"></script>
<script type=text/javascript" src="//domain.com/video-s/nuevo.min.js"></script>

<video id="myplayer" class="video-js" poster="//domain.com/path/to/poster.jpg" controls preload="auto">
  <source src="//domain.com/path/to/playlist.m3u8" type="application/x-mpegURL">
</video>

<script>
// Optionally override HTML native playback, usually required for Android devices, but not for iOS.
videojs.options.hls.overrideNative = true;
videojs.options.html5.nativeAudioTracks = false;
videojs.options.html5.nativeTextTracks = false;

//Initialize videojs player
var player = videojs('myplayer');
player.nuevo({
	logo: "//domain.com/path/to/logo.png",
	logourl: "/domain.com"
});
</script>

HLS Device and Cross Browser Support

Chrome - Supported since Chrome version 30+
Firefox - Supported since Firefox version 42+
Internet Explorer 10+ - Supported since IE 11 (Windows 8+ only)
Microsoft Edge
Safari - Supported since Safari version 8+
Opera - Supported since Opera version 15+

Android - Supported on Chrome and Firefox for Android 4.0+
IOS - Supported on iOS 3+ (only native streaming)
Windows Phone - Supported on Windows Phone 8+


Standard Video Format Fallback

Since not every browser on certain platform supports MediaSourceExtension required to play HLS stream, it is suggested to offer fallback to standard video format like MP4 or WEBM.
Nuevo plugin automatically detects MediaSourceExtension support in browser, so you can define fallback video within same source element. It's even possible to provide multiple quality fallback sources. Both demos on this page use such fallback, so for example this is not a problem to keep player working on Windows 7 with IE 11 where MediaSourceExtension and HLS playback is not supported. See the code example below.
Code snippet

<script type=text/javascript" src="//domain.com/video-js/video.min.js"></script>
<script type=text/javascript" src="//domain.com/video-js/nuevo.min.js"></script>

<video id="myplayer" class="video-js" poster="//domain.com/path/to/poster.jpg" controls preload="auto">
  <source src="//domain.com/path/to/playlist.m3u8" type="application/x-mpegURL">
  // Fallback mp4 video with multiple resolution variants  
  <source src="//domain.com/path/to/video_720p.mp4" type="video/mp4" res="720" label="720p">
  <source src="//domain.com/path/to/video_480p.mp4" type="video/mp4" res="480" label="480p">
  <source src="//domain.com/path/to/video_240p.mp4" type="video/mp4" res="240" label="240p">
</video>

<script>
// Optionally to override HTML native playback
videojs.options.hls.overrideNative = true;
videojs.options.html5.nativeAudioTracks = false;
videojs.options.html5.nativeTextTracks = false;

//Initialize videojs player
var player = videojs('myplayer',{},function(){ 
	this.nuevoPlugin({
		logo: "//domain.com/path/to/logo.png",
		logourl: "/domain.com"
	});
});
</script>


Same video fallback technique you can use for Mpeg-Dash stream.


For videojs version 6 you need to load videojs-contrib-hls plugin right after videojs loaded.
Code snippet

<script type=text/javascript" src="//domain.com/video-js/video.min.js"></script>
<script type=text/javascript" src="//domain.com/video-js/plugins/videojs-contrib-hls.min.js"></script>
<script type=text/javascript" src="//domain.com/video-js/nuevo.min.js"></script>