From 44c909c0957bf751ed26f0ebb66aa96174f908f2 Mon Sep 17 00:00:00 2001
From: xc <double72cheng@gmail.com>
Date: Thu, 15 Apr 2021 13:38:41 +0800
Subject: [PATCH] 新增历史监控时间轴

---
 src/main/resources/public/index.html |  132 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 126 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/public/index.html b/src/main/resources/public/index.html
index bd0ce9c..bf0bcc2 100755
--- a/src/main/resources/public/index.html
+++ b/src/main/resources/public/index.html
@@ -1,10 +1,11 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
 <html>
 
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <title>Jessibuca 1.0</title>
     <meta charset="utf-8"/>
+    <link rel="stylesheet" href="css/index.css">
     <style>
         .btn {
             display: inline-block;
@@ -70,12 +71,80 @@
             overflow-y: auto;
             padding: 5px;
         }
+		
+		/* ================ 播放器控制面板样式 start ================ */
+		.controls-container {
+		    width: 720px;
+		    height: 40px;
+		    position: absolute;
+		    left: 0px;
+		    bottom: -40px;
+		    background-color: #000;
+		}
+		
+		/* 播放/暂停 */
+		.controls-container .switch {
+		    width: 20px;
+		    height: 20px;
+		    display: block;
+		    font-size: 20px;
+		    color: #fff;
+		    position: absolute;
+		    left: 10px;
+		    top: 10px;
+		}
+		/* 全屏 */
+		.controls-container .expand {
+		    width: 20px;
+		    height: 20px;
+		    display: block;
+		    font-size: 20px;
+		    color: #fff;
+		    position: absolute;
+		    right: 10px;
+		    top: 10px;
+		}
+		/* 进度条 */
+		.controls-container .progress {
+		    width: 430px;
+		    height: 10px;
+		    position: absolute;
+		    left: 40px;
+		    bottom: 15px;
+		    background-color: #555;
+		}
+		.controls-container .progress .bar {
+		    /*width: 100%;*/
+		    width: 430px;
+		    height: 100%;
+		    border-radius: 3px;
+		    cursor: pointer;
+		    position: absolute;
+		    left: 0;
+		    top: 0;
+		    opacity: 0;
+		    z-index: 999;
+		}
+		.controls-container .progress .loaded {
+		    width: 60%; /* 视频缓存的进度, 后期可动态变化 */
+		    height: 100%;
+		    background-color: #999;
+		    border-radius: 3px;
+		    position: absolute;
+		    left: 0;
+		    top: 0;
+		    z-index: 2;
+		}
+		/* ================ 播放器控制面板样式 end ================ */
     </style>
 </head>
 
 <body>
 <div class="player-wrapper" id="container" style="background-color: #0D0E1B;width:900px;height:500px">
 </div>
+
+
+<div id="progressTime"></div> 
 <div class="btn-wrapper" id="playDom">
     <button class="btn" id="play">播放</button>
 </div>
@@ -88,11 +157,18 @@
 <div id="logout" class="logs">
 </div>
 
+<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
 <script src="./ajax.js"></script>
 <script src="./renderer.js"></script>
-<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
+<script type="text/javascript" src="js/jquery.min.js"></script>
+<script type="text/javascript" src="js/jquery.progressTime.js"></script>
+
 
 <script>
+    var hourTimestamp = 3600 * 1000;
+    var dayTimestamp = hourTimestamp * 24;
+    var currentTimer;
+
     onerror = handleErr;
     var txt = "";
     window.onkeydown = function () {
@@ -109,6 +185,50 @@
     let decoder = queryParam('decoder') || 'ff';
     let source = queryParam('source') || 'localhost';
     var h5lc = new Jessibuca({container, decoder: decoder + ".js", videoBuffer: 0});
+
+
+    $("#progressTime").ProgressTime({
+        container: "progressTime",
+        startTime: new Date(formatDate(new Date(new Date().getTime() - dayTimestamp * 3), "YYYY/MM/DD 00:00:00")),
+        endTime: new Date(formatDate(new Date(), "YYYY/MM/DD 00:00:00")),
+        currentTime: new Date(formatDate(new Date(new Date().getTime() - dayTimestamp * 2), "YYYY/MM/DD 12:00:00")),
+        interval: 300,
+        delay: 2000,
+        isNow: false, // 是否显示右侧回到当前时间
+        toPlay: false, // 渲染是否完成
+        animateFinish: false, // 动画是否完成
+        callback: function (config) {
+            console.log(config);
+            currentTimer=config.time;
+        },
+        animateCallback: function (config) {
+
+            // 假如动画完成之后请求数据需要两秒
+            var timer = setTimeout(function () {
+                progressTime.options.toPlay = true; // 两秒之后再继续走播放条
+                clearTimeout(timer);
+            }, 0);
+        }
+    });
+    $(".progressTime-left-b-start").on("click", function () {
+        if(currentTimer){
+            $(this).addClass("stop");
+
+            $.ajax({
+                url: ""+"?param=",
+                async: false,//同步方式发送请求,true为异步发送
+                type: "GET",
+                data: {},
+                success: function (result) {
+                    alert(result);
+                }
+            });
+
+        }
+    });
+    $(".progressTime-left-b-start stop").on("click", function () {
+        $(this).removeClass("stop");
+    });
 
     h5lc.onLoad = function () {
         //this.play("wss://pulls.1234326.cn/live/L01.flv")
@@ -127,10 +247,10 @@
             return;
         }
         isPlaying = true;
-/*        $.get("http://127.0.0.1:8088/monica/test/video", function (data) {
-                h5lc.play(data)
-            }
-        );*/
+        /*        $.get("http://127.0.0.1:8088/monica/test/video", function (data) {
+                        h5lc.play(data)
+                    }
+                );*/
         play();
         $playDom.style.display = 'none';
         $stopDom.style.display = 'block';

--
Gitblit v1.9.1