28 lines
929 B
HTML
28 lines
929 B
HTML
<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>
|