Spaces:
Sleeping
Sleeping
<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> | |