1 Star 0 Fork 0

boysic / v4l2rtspserver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.html 927 Bytes
一键复制 编辑 原始数据 按行查看 历史
mpromonet 提交于 2021-04-03 22:33 . center hls
<html>
<link rel="shortcut icon" href="about:blank"/>
<style>
h3 { text-align: center }
video { display: block; margin: 0 auto }
</style>
<body>
<!--fill streamList variable with the list of streams -->
<script src="/getStreamList?streamList" ></script>
<h3>HLS</h3>
<div id="videos"></div>
<script src="hls.js/dist/hls.light.min.js" ></script>
<script>
if (Hls.isSupported()) {
var videos = document.getElementById("videos")
streamList.forEach( (stream) => {
var title = document.createElement("h3");
title.innerText = stream
videos.appendChild(title)
var video = document.createElement("video");
videos.appendChild(video)
var hls = new Hls();
hls.loadSource(stream+".m3u8");
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() { video.play(); });
})
} else {
alert("HLS not supported");
}
</script>
</body>
</html>
1
https://gitee.com/boysic/v4l2rtspserver.git
git@gitee.com:boysic/v4l2rtspserver.git
boysic
v4l2rtspserver
v4l2rtspserver
master

搜索帮助