This commit is contained in:
marcsello 2025-10-07 21:38:17 +02:00
commit 0cbcd9a837
9 changed files with 244 additions and 0 deletions

28
index.html Normal file
View file

@ -0,0 +1,28 @@
<html>
<head>
<meta charset="UTF-8">
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
</head>
<body>
<video id="video" style="width: 100%; height: auto; max-height: 720px;" controls></video>
<script>
var video = document.getElementById('video');
var videoSrc = 'video/bbb.m3u8';
if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(videoSrc);
hls.attachMedia(video);
}
// HLS.js is not supported on platforms that do not have Media Source
// Extensions (MSE) enabled.
//
// When the browser has built-in HLS support (check using `canPlayType`),
// we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video
// element through the `src` property. This is using the built-in support
// of the plain video element, without using HLS.js.
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = videoSrc;
}
</script>
</body>
</html>