M3U8 and HLS explained:
what an m3u8 file is and how to play it
A M3U8 file is a plain text playlist used for HTTP Live Streaming (HLS). It acts as an index, telling a video player where to find the audio and video segments needed to stream media over the internet. Test your own stream using our live M3U8 player below.
Something not playing? The online M3U8 player plays a stream with no embed code and reports the actual error (CORS, mixed content, DRM or codec) instead of an empty box. To check the playlist itself, use the HLS playlist inspector.
Embed this stream on your website with HTML code below: Copy
Do you want to customise player or get playback stats ?
Create free account and configure own player Start Free
Do you want more details ? See below ...
Quick answers
What is an m3u8 file?
An M3U8 file is the plain-text playlist of an HTTP Live Streaming (HLS) stream. It lists the quality variants of the stream and, for each variant, the media segments, their durations and where to fetch them. The video is in the segments, not in the playlist. That's why opening a .m3u8 URL in a browser shows text.
What are the files in an HLS stream?
Two kinds. The .m3u8 manifests are the playlists: a master playlist points at one media playlist per quality, and each media playlist points at the segments. The .ts files, or fragmented .mp4 segments in newer packaging, carry the video itself.
What are the advantages of HLS?
HLS plays natively on Apple platforms and on most televisions, travels over ordinary HTTP so any CDN can cache it, and adapts quality to the connection by switching between segment sets. That combination is why it's the default for both VOD and live delivery.
Where each question is answered
This page is the hub. Each link below takes one question and answers it on its own.
- How to play an M3U8 file - the three routes that work, and why a downloaded playlist will not play.
- HLS vs M3U8 vs DASH - protocol, playlist and the competing standard, in one table, with the content types.
- Embed an HLS stream in HTML - native
<video>for Safari, hls.js for everything else, and the CORS rule that breaks most embeds. - Online M3U8 player - play a playlist URL now, with the real error when it fails.
- HLS playlist inspector - parse and validate the manifest itself: variants, codecs, timing, LL-HLS.
What is m3u8 file ?
Probably you already found some link looking like https://bradmax.com/static/video/tos/440272.m3u8
This is a link to a small text file, which defines HLS stream (HTTP Live Streaming). Such “stream” is simply one media splitted smartly into multiple files, which gives the ability to adjust playback to your internet connection speed. If you have a fast internet connection, then video with the highest quality will be used. If you got poor connection with a streaming server then automatically lower quality will be used.
Files in HLS stream
There are two types of files for HLS stream:
*.m3u8- manifest files, which are ordinary text files containing important information about whole stream (how many video qualities are available, where to find them, if there are different audio / text tracks - for multi-language streams and more).*.ts- video segment files. These files contain video splitted into small parts for each defined quality. This gives the player the ability to “switch” video stream from one quality to another one for adapting to current connection speed between user and streaming server.
Advantages of HLS
HLS is a very common stream format with best support on most devices. It can be played natively on Android or iOS devices and with small help on PC devices too (for example you can use hls.js library for it). This is the best format for non-DRM content distribution (For DRM content it is not so easy).
For playback you can use different video players and by yourself choose, which one use on which platform.
Or you can use simply our free player, which handles it automatically. You just need to paste link to *.m3u8
main manifest into player configuration and player will do the rest.
Because of good support HLS it is widely used in many applications like:
- VOD content streaming
- live content streaming (web video cameras, event transmissions, etc.)
Examples
1. Putting player directly into your HTML page
<script src="https://bradmax.com/client/files/player-js/73a9716fd26717763cd2d46fb9e41463645853de_14815/bradmax_player.js" ></script>
<div style="width: 890px; height: 500px; background: black;" id="PLAYER_DOM_ID"></div>
<script type="text/javascript">
var config = {
dataProvider: {
source: [
{ url: "https://bradmax.com/static/video/tos/440272.m3u8" }
]
}
};
/** find player container in html DOM tree. */
var element = document.getElementById("PLAYER_DOM_ID");
/** create player */
var player = window.bradmax.player.create(element, config);
</script>
For player documentation see: https://bradmax.com/static/player-doc/configuration.html#html-player-configuration
2. Iframe embed code
For simplicity we also provide small embed HTML code with iframe (very similar to youtube embed code). You can easily generate it via our client panel.
<iframe src="https://bradm.ax/build/202606/10/e1c1f29d59fb2a341df6fe3103a41b06338c2049/index.html?mediaUrl=https%3A%2F%2Fbradmax.com%2Fstatic%2Fvideo%2Ftos%2F440272.m3u8" width="600" height="400" frameBorder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
For player documentation see: https://bradmax.com/static/player-doc/iframeembed.html
3. Wordpress plugin
If you are familiar with Wordpress CMS, then you can try our Bradmax plugin: https://pl.wordpress.org/plugins/bradmax-player/
Embedding player in simple case is very easy with Wordpress shot-code
[bradmax_video url="https://bradmax.com/static/video/tos/big_buck_bunny.m3u8" duration="596" poster="https://bradmax.com/static/images/startsplash.jpg"]
See wikipedia for more details about HLS format: HTTP Live Streaming