first commit

This commit is contained in:
kenneth
2023-11-28 09:50:42 +00:00
parent d940668996
commit 5a01af92af
33 changed files with 1939 additions and 0 deletions

2
web/statics/js/hls.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>首页 - HLS流视频</title>
<style>
.container{
width: 640px;
}
.container #video{
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<video id="video" controls></video>
</div>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script>
var video = document.getElementById('video');
if(Hls.isSupported()) {
console.log("supported");
var hls = new Hls();
hls.loadSource('http://192.168.9.252:9090/statics/clip7iilsbb2u3en7mt0/index.m3u8');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function() {
video.play();
});
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
console.log("no supported");
video.src = 'http://192.168.9.252:9090/stream';
video.addEventListener('loadedmetadata',function() {
video.play();
});
}
</script>
</body>
</html>

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>上传 - HLS流视频</title>
<style>
.container{
width: 640px;
}
</style>
</head>
<body>
<div class="container">
<form id="form" enctype="multipart/form-data" action="/upload" method="POST">
<label for="avatar">请选择文件:</label><br>
<input type="file" id="file" name="file" /><br>
<button class="button" type="submit">提交</button>
</form>
</div>
</body>
</html>