Play the Live Stream
Each video stream is available at https://stream.comprimato.com/
. The URL for your particular stream is formatted: https://stream.comprimato.com/hls/${player_key}.m3u8
. You will have received the player_key
value in the REST API response, as described in the chapter Create a live stream. Or simply make a GET
request to https://api.comprimato.com/v1/streams/{id}
and get the player_key
value from there.
In our example, the complete URL is http://stream.comprimato.com/hls/lU1rTlq0mwc1.m3u8
.
URL for HLS streams:
Your video player should be pointed to
https://stream.comprimato.com/hls/${player_key}.m3u8
.
Supported players
- HLS.js is an open source HLS video player. Please note that the HLS.js library does not have any UI components. You can create your own buttons and controls or use the default HTML5
<video>
controls. - Video.js is a widely used open source video player, built from the ground up for an HTML5 world.
- Plyr.io is open source, simple, lightweight and customisable HTML5 media player. Plyr extends the standard HTML5
<video>
element. and by default does not support HLS. However it can be integrated with HLS.js.
Using VLC
- In the VLC menu, go to
Media > Open Network Stream
. - Copy the stream URL into the address field.
- Press
Enter
or thePlay
button.
Browser
You can use the HLS.js player to play the video in a browser if HLS is not supported natively.
<!-- This example was adapted from hls.js documentation -->
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video id="video" controls></video>
<script>
var video = document.getElementById('video');
var playerKey = 'your-player-key'; // taken from stream.player_key
var videoSrc = 'https://stream.comprimato.com/hls/' + playerKey + '.m3u8';
// Check for native browser HLS support
// HLS is currently supported in Safari
if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = videoSrc;
// In other browsers, check if HLS.js player supports them
} else if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(videoSrc);
hls.attachMedia(video);
} else {
console.error('HLS is not supported.')
}
</script>
Updated over 2 years ago