Skip to main content

Playing the Live Stream

To play the Live Stream you will need to use the HLS URL that Metered provides in a HLS media player as most browsers video tag does not support HLS Streams.

How to get the HLS URL in Metered Dashboard​

Two dashboards

Screenshots below show the new dashboard. If you use the classic dashboard, pick the Classic dashboard tab — your choice is remembered on every page. You can switch at any time: Old dashboard in the header takes you back to the classic dashboard, and dashboard.metered.ca/v2 opens the new one. What changed in the new dashboard →

Once you enable live streaming in Metered (to learn more about how to enable live streaming in Metered Click Here), you can get the live stream URL from the room's page:

Video API & SDK -> Rooms -> the room's ⋮ menu -> View

In the Room summary, the Live streaming (HLS/Dash) row shows the HLS URL (ending in .m3u8), with a copy button.

HLS live stream URL on the room page hls live stream url Metered

How to use HLS URL in a player​

Many browsers do not support HLS natively in the html video. You will need a player to support HLS playback in the browser and on iOS and Android apps.

A good player is the HLS.js library. HLSjs functionality onto the existing HTML5 video element.

The default player in iOS and TVOS (AVPlayer) has HLS support built in, so no other library is needed.

For Android the default EXO player also supports HLS natively.

Implementation for different cases:

HTML

<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>

<video
id="my-player"
controls
style="width: 100%; max-width: 500px;"
/>

<script>
const video = document.querySelector('#my-player');
const src = 'https://live.metered.ca/hls/{PLAYBACK_ID}.m3u8';

if (video.canPlayType('application/vnd.apple.mpegurl')) {
// Some browers (safari and ie edge) support HLS natively
video.src = src;
} else if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(src)
hls.attachMedia(video);

} else {
console.error("This is a legacy browser that doesn't support MSE");
}

</script>

List of Players for playing Live Stream in your website or app.​

There are many free players on the web that supports HLS Live Streaming. Here is list of some of the popular ones

Apart from these there are many others you can pick and choose from.