2024-10-29 18:29:56 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="zh-CN">
|
2024-11-01 18:21:57 +08:00
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
2024-11-01 00:15:12 +08:00
|
|
|
<title>视频中心</title>
|
2024-10-29 18:29:56 +08:00
|
|
|
<link rel="stylesheet" href="/layui/css/layui.css">
|
|
|
|
</head>
|
|
|
|
|
2024-11-01 18:21:57 +08:00
|
|
|
<body class="layui-bg-gray">
|
2024-10-29 18:29:56 +08:00
|
|
|
<div id="header"></div>
|
2024-11-02 18:24:16 +08:00
|
|
|
<div class="layui-row">
|
|
|
|
<div class="layui-col-xs2">
|
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
|
<div class="layui-panel" style="width: auto; margin: 16px;">
|
|
|
|
<ul class="layui-menu" id="menusss">
|
|
|
|
<div id="menuView"></div>
|
|
|
|
</ul>
|
|
|
|
|
2024-11-01 18:21:57 +08:00
|
|
|
</div>
|
2024-11-02 18:24:16 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-col-xs9">
|
|
|
|
<div class="grid-demo">
|
|
|
|
<video id="videoElement" style="width: 80%; margin-top: 16px;" controls></video>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-11-01 18:21:57 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
</body>
|
2024-11-01 18:21:57 +08:00
|
|
|
<script id="menulist" type="text/html">
|
|
|
|
<ul class="layui-tab-title">
|
2024-11-02 18:24:16 +08:00
|
|
|
|
|
|
|
{{# layui.each(Object.keys(d), function(index, item){ }}
|
|
|
|
<li class="layui-menu-item-group layui-menu-item-down" lay-options="{type: 'group'}">
|
|
|
|
<div class="layui-menu-body-title">
|
|
|
|
{{= item}} <i class="layui-icon layui-icon-up"></i>
|
|
|
|
</div>
|
|
|
|
<ul>
|
|
|
|
{{# layui.each(d[item], function(index, video){ }}
|
|
|
|
<li lay-options="{id: {{= video.path}} }">
|
|
|
|
<div class="layui-menu-body-title">{{= video.name}}</div>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
{{# }); }}
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
2024-11-01 00:15:12 +08:00
|
|
|
{{# }); }}
|
2024-11-02 18:24:16 +08:00
|
|
|
|
2024-11-01 00:15:12 +08:00
|
|
|
</ul>
|
2024-10-29 18:29:56 +08:00
|
|
|
</script>
|
|
|
|
<script src="/js/jquery-3.2.1.js"></script>
|
|
|
|
<script src="/js/CommonConfig.js"></script>
|
2024-11-01 18:21:57 +08:00
|
|
|
<script src="/js/httpUtils.js"></script>
|
|
|
|
<script src="/layui/layui.js"></script>
|
2024-11-02 18:24:16 +08:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
|
|
|
|
|
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
<script>
|
2024-11-01 18:21:57 +08:00
|
|
|
headerModel = 2;
|
2024-10-29 18:29:56 +08:00
|
|
|
$('#header').load("/html/header.html");
|
2024-11-01 18:21:57 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
|
2024-11-01 18:21:57 +08:00
|
|
|
<script>
|
|
|
|
|
|
|
|
var roomId = '17961';
|
|
|
|
layui.use(['dropdown', 'laytpl'], function () {
|
|
|
|
var dropdown = layui.dropdown;
|
2024-11-01 00:15:12 +08:00
|
|
|
var layer = layui.layer;
|
2024-11-01 18:21:57 +08:00
|
|
|
var laytpl = layui.laytpl;
|
|
|
|
function initTabs() {
|
2024-11-02 18:24:16 +08:00
|
|
|
getVideo(roomId, 0, 0)
|
2024-11-01 18:21:57 +08:00
|
|
|
.then(data => {
|
2024-11-02 18:24:16 +08:00
|
|
|
initMenu(data.data.children)
|
2024-11-01 18:21:57 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
dropdown.on('click(menusss)', function (options) {
|
2024-11-02 18:24:16 +08:00
|
|
|
console.log(options);
|
|
|
|
// playVideo()
|
|
|
|
getPlayerVideo(roomId, options.id)
|
|
|
|
.then(data => {
|
|
|
|
playVideo(data.data)
|
|
|
|
})
|
2024-11-01 18:21:57 +08:00
|
|
|
|
|
|
|
});
|
|
|
|
function initMenu(data) {
|
|
|
|
var view = $("#menuView").get(0);
|
|
|
|
laytpl($('#menulist').get(0).innerHTML).render(data, function (html) {
|
2024-11-02 18:24:16 +08:00
|
|
|
console.log(html)
|
2024-11-01 18:21:57 +08:00
|
|
|
view.innerHTML = html;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function init() {
|
2024-11-02 18:24:16 +08:00
|
|
|
initTabs()
|
2024-11-01 18:21:57 +08:00
|
|
|
|
|
|
|
}
|
2024-11-02 18:24:16 +08:00
|
|
|
function playVideo(url) {
|
|
|
|
var video = document.getElementById('videoElement');
|
|
|
|
var videoSrc = url;
|
|
|
|
var hls = new Hls();
|
|
|
|
hls.loadSource(videoSrc);
|
|
|
|
hls.attachMedia(video);
|
|
|
|
}
|
2024-11-01 18:21:57 +08:00
|
|
|
init()
|
|
|
|
|
2024-11-01 00:15:12 +08:00
|
|
|
})
|
2024-10-30 18:27:37 +08:00
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
</script>
|
2024-11-01 18:21:57 +08:00
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
<style>
|
|
|
|
|
|
|
|
</style>
|
2024-11-01 18:21:57 +08:00
|
|
|
|
2024-10-29 18:29:56 +08:00
|
|
|
</html>
|