From 49207386ea4a3d663628347eef443af9c7cc7f39 Mon Sep 17 00:00:00 2001 From: aijinhui <aijinhui> Date: 星期二, 17 十月 2023 17:20:46 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ard-work/src/main/resources/templates/test.html | 75 ++++++++++++++++++++++++------------- 1 files changed, 48 insertions(+), 27 deletions(-) diff --git a/ard-work/src/main/resources/templates/test.html b/ard-work/src/main/resources/templates/test.html index bc58555..5b3d7d9 100644 --- a/ard-work/src/main/resources/templates/test.html +++ b/ard-work/src/main/resources/templates/test.html @@ -130,9 +130,11 @@ </div> </div> </div> -<script th:inline="javascript"> - var cameraId, opt, token; +<script th:inline="javascript" th:type="module"> + + var cameraId, opt, optOpen, optClose, token; window.onload = function () { + console.log(RTCRtpReceiver.getCapabilities('video').codecs) $.ajax({ url: "../hik/list", type: "get", @@ -161,7 +163,6 @@ } } }) - opt = {"username": "admin", "password": "admin123"}; $.ajax({ headers: { @@ -308,7 +309,7 @@ $("#setPreset").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1, "speed": 8, "presetIndex": 1}; + opt = {"cameraId": cameraId, "chanNo": 1, "speed": 8, "presetIndex": 1}; $.ajax({ headers: { 'Accept': 'application/json', @@ -326,7 +327,7 @@ }) $("#gotoPreset").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1, "speed": 8, "presetIndex": 1}; + opt = {"cameraId": cameraId, "chanNo": 1, "speed": 8, "presetIndex": 1}; $.ajax({ headers: { 'Accept': 'application/json', @@ -344,7 +345,7 @@ }) $("#getPTZ").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1}; + opt = {"cameraId": cameraId, "chanNo": 1}; $.ajax({ headers: { 'Accept': 'application/json', @@ -370,7 +371,7 @@ var z = $('#z').val(); //瀹氫箟涓�涓甫鏈塎ap瀛楁鐨勫疄浣撳璞� var myEntity = { - channelNum: 1, + chanNo: 1, cameraId: cameraId, ptzMap: { p: p, @@ -401,7 +402,7 @@ var targetP = $('#targetPostion').val(); //瀹氫箟涓�涓甫鏈塎ap瀛楁鐨勫疄浣撳璞� var myEntity = { - channelNum: 1, + chanNo: 1, cameraId: cameraId, targetPosition: targetP, camPosition: camP, @@ -424,7 +425,7 @@ }) $("#setZeroPTZ").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1}; + opt = {"cameraId": cameraId, "chanNo": 1}; $.ajax({ headers: { 'Accept': 'application/json', @@ -442,7 +443,7 @@ }) $("#WiperPwron").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1, "speed": 8, "enable": true, "code": 16}; + opt = {"cameraId": cameraId, "chanNo": 1, "speed": 8, "enable": true, "code": 16}; $.ajax({ headers: { 'Accept': 'application/json', @@ -461,8 +462,8 @@ var defogflag = true; $("#Defogcfg").click(function () { cameraId = $('#select option:selected').val(); - optOpen = {"cameraId": cameraId, "channelNum": 1, "enable": true}; - optClose = {"cameraId": cameraId, "channelNum": 1, "enable": false}; + optOpen = {"cameraId": cameraId, "chanNo": 1, "enable": true}; + optClose = {"cameraId": cameraId, "chanNo": 1, "enable": false}; if (defogflag) { $(this).text("鍏抽棴閫忛浘"); defogflag = false; @@ -503,8 +504,8 @@ var infrareflag = true; $("#Infrarecfg").click(function () { cameraId = $('#select option:selected').val(); - optOpen = {"cameraId": cameraId, "channelNum": 1, "enable": true}; - optClose = {"cameraId": cameraId, "channelNum": 1, "enable": false}; + optOpen = {"cameraId": cameraId, "chanNo": 1, "enable": true}; + optClose = {"cameraId": cameraId, "chanNo": 1, "enable": false}; if (infrareflag) { $(this).text("鍏抽棴绾㈠"); infrareflag = false; @@ -545,8 +546,8 @@ var focusModeflag = true; $("#FocusMode").click(function () { cameraId = $('#select option:selected').val(); - optOpen = {"cameraId": cameraId, "channelNum": 1, "enable": true}; - optClose = {"cameraId": cameraId, "channelNum": 1, "enable": false}; + optOpen = {"cameraId": cameraId, "chanNo": 1, "enable": true}; + optClose = {"cameraId": cameraId, "chanNo": 1, "enable": false}; if (focusModeflag) { $(this).text("鑷姩鑱氱劍"); focusModeflag = false; @@ -583,11 +584,30 @@ }) } }) + $("#getFocusPos").click(function () { + cameraId = $('#select option:selected').val(); + opt = {"cameraId": cameraId, "chanNo": 1}; + $.ajax({ + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': token + }, + url: "../hik/getFocusPos", + type: "post", + dataType: "json", + data: JSON.stringify(opt), + success: function (datas) { + console.log(datas); + $("#focus").val(datas.data.dwFocus); + } + }) + }) var heateRpwronflag = true; $("#HeateRpwron").click(function () { cameraId = $('#select option:selected').val(); - optOpen = {"cameraId": cameraId, "channelNum": 1, "enable": true}; - optClose = {"cameraId": cameraId, "channelNum": 1, "enable": false}; + optOpen = {"cameraId": cameraId, "chanNo": 1, "enable": true}; + optClose = {"cameraId": cameraId, "chanNo": 1, "enable": false}; if (heateRpwronflag) { $(this).text("鍏抽棴浜戝彴鍔犵儹"); heateRpwronflag = false; @@ -627,8 +647,8 @@ var CameraDeicingflag = true; $("#CameraDeicing").click(function () { cameraId = $('#select option:selected').val(); - optOpen = {"cameraId": cameraId, "channelNum": 1, "enable": true}; - optClose = {"cameraId": cameraId, "channelNum": 1, "enable": false}; + optOpen = {"cameraId": cameraId, "chanNo": 1, "enable": true}; + optClose = {"cameraId": cameraId, "chanNo": 1, "enable": false}; if (CameraDeicingflag) { $(this).text("鍏抽棴闀滃ご鍔犵儹"); CameraDeicingflag = false; @@ -666,7 +686,7 @@ }) $("#realCutPic").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1}; + opt = {"cameraId": cameraId, "chanNo": 1}; $.ajax({ headers: { 'Accept': 'application/json', @@ -685,7 +705,7 @@ }) $("#saveCutPic").click(function () { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1}; + opt = {"cameraId": cameraId, "chanNo": 1}; $.ajax({ headers: { 'Accept': 'application/json', @@ -705,8 +725,8 @@ var recordflag = true; $("#record").click(function () { cameraId = $('#select option:selected').val(); - optOpen = {"cameraId": cameraId, "channelNum": 1, "enable": true}; - optClose = {"cameraId": cameraId, "channelNum": 1, "enable": false}; + optOpen = {"cameraId": cameraId, "chanNo": 1, "enable": true}; + optClose = {"cameraId": cameraId, "chanNo": 1, "enable": false}; if (recordflag) { $(this).text("鍋滄褰曞儚"); recordflag = false; @@ -749,7 +769,7 @@ /*浜戝彴鍏叡鏂规硶*/ function commondMethod(url, code, enable) { cameraId = $('#select option:selected').val(); - opt = {"cameraId": cameraId, "channelNum": 1, "speed": 8, "enable": enable, "code": code}; + opt = {"cameraId": cameraId, "chanNo": 1, "speed": 8, "enable": enable, "code": code}; $.ajax({ headers: { 'Accept': 'application/json', @@ -782,14 +802,15 @@ } else if (camera.type == "dh") { realViewDh("127.0.0.1", ID, camera.username, camera.password, camera.ipaddr, camera.port); } else { - realViewHik("192.168.1.15", ID, camera.username, camera.password, camera.ipaddr, camera.port); + realViewHik("127.0.0.1", ID, camera.username, camera.password, camera.ipaddr, camera.port); } } }); //棰勮娴峰悍鐩告満 function realViewHik(serverip, elem, username, password, ipaddr, port) { - webRtcServer = new WebRtcStreamer(elem, "http://" + serverip + ":8000"); + // webRtcServer = new WebRtcStreamer(elem, "http://" + serverip + ":8000"); + webRtcServer = new WebRtcStreamer(elem, "http://192.168.1.227:8000"); let rtspUrl = "rtsp://" + username + ":" + password + "@" + ipaddr + ":" + port + "/ch1/main/av_stream"; let option = "rtptransport=tcp"; console.log("rtsp鍦板潃锛�" + rtspUrl); -- Gitblit v1.9.3