ai_companion / ai_companion_front_end_loop.html
zmbfeng's picture
new html files
391bae3
raw
history blame contribute delete
787 Bytes
<!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>