Spaces:
Sleeping
Sleeping
File size: 787 Bytes
391bae3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<!DOCTYPE html>
<html>
<head>
<title>Loop HLS Stream</title>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
</head>
<body>
<video id="video" controls autoplay></video>
<script>
var video = document.getElementById('video');
var hls = new Hls();
var source = 'http://localhost:7860/hls/output.m3u8'; // Adjust the URL accordingly
hls.loadSource(source);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_LOADED, function () {
video.play();
});
video.onended = function() {
// Force reload of the playlist when it ends
hls.detachMedia();
hls.loadSource(source);
hls.attachMedia(video);
};
</script>
</body>
</html>
|