Files
dbr/examples/bayern.html
2024-07-23 20:34:25 +02:00

61 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Stream Player</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
background-color: black; /* Hintergrundfarbe auf Schwarz setzen */
}
#video-container {
width: 100%;
height: 100%;
position: relative;
}
video {
width: 100%;
height: 100%;
}
#fullscreen-button {
position: absolute;
top: 10px;
right: 10px;
z-index: 999;
}
</style>
</head>
<body>
<div id="video-container">
<video id="videoPlayer" controls autoplay playsinline muted></video>
</div>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script>
const videoPlayer = document.getElementById('videoPlayer');
// Add event listener when video ends to loop it
videoPlayer.addEventListener('ended', function() {
this.load();
this.play();
});
// Check if HLS.js is supported
if (Hls.isSupported()) {
const hls = new Hls();
const proxyUrl = 'http://127.0.0.1:8090/cors?url=https://brevent.akamaized.net/hls/live/2028222/event_05/master1080p5000.m3u8';
hls.loadSource(proxyUrl);
hls.attachMedia(videoPlayer);
} else {
console.error('HLS not supported');
}
</script>
</body>
</html>