From 141eaea94def1ad0a453ccce54a415f0688499fe Mon Sep 17 00:00:00 2001 From: qiushui Date: Tue, 18 Jan 2022 15:37:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B7=E9=81=93=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.json | 2 +- index.html | 42 ++++++++++---------- street.html | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 22 deletions(-) create mode 100644 street.html diff --git a/config.json b/config.json index dfc8e15..70d00e8 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "serverIp": "http://localhost:9007", + "serverIp": "http://192.168.8.140:9007", "webRtcIp": "192.168.8.140:8083" } \ No newline at end of file diff --git a/index.html b/index.html index 4eb8c39..e444519 100644 --- a/index.html +++ b/index.html @@ -16,28 +16,28 @@ let webRtc = data["webRtcIp"] WebRtcPlayer.setServer(webRtc); $.ajax({ - url:ip+'/api/realTime/allCameras', - type:'get', - data:{}, - dataType:'json', - success:function(data){ - for(camera of data.data){ - var video = document.createElement('video') - video.setAttribute('id',camera.id) - video.autoplay = true - video.controls = true - video.muted = true - video.style = 'width:700px;' - video.setAttribute('class','video') - body.appendChild(video) - let player = new WebRtcPlayer(camera.id,'camera'+camera.id); - player.load('camera'+camera.id) + url:ip+'/api/realTime/allCameras', + type:'get', + data:{}, + dataType:'json', + success:function(data){ + for(camera of data.data){ + var video = document.createElement('video') + video.setAttribute('id',camera.id) + video.autoplay = true + video.controls = true + video.muted = true + video.style = 'width:700px;' + video.setAttribute('class','video') + body.appendChild(video) + let player = new WebRtcPlayer(camera.id,'camera'+camera.id); + player.load('camera'+camera.id) + } + }, + error:function(){ + console.log('请求出错!'); } - }, - error:function(){ - console.log('请求出错!'); - } - }) + }) }); diff --git a/street.html b/street.html new file mode 100644 index 0000000..dc0d626 --- /dev/null +++ b/street.html @@ -0,0 +1,110 @@ + + + + +
+ +
+
+ + + + \ No newline at end of file