Commit 8d299a794ae9919274da38a0f63350b4814da73d
Merge branch 'pudong_jdk8_wvp' of http://192.168.168.245:8888/panzhaov5/bsth_con…
…trol into pudong_jdk8_wvp
Showing
5 changed files
with
41 additions
and
54 deletions
src/main/java/com/bsth/controller/video/VideoController.java
| ... | ... | @@ -108,6 +108,7 @@ public class VideoController { |
| 108 | 108 | result.put("data", videoChannels); |
| 109 | 109 | result.put("channelImageURL", wvpConfig.getChannelListOfImgURL()); |
| 110 | 110 | result.put("wvpPlayURL", wvpConfig.getWvpPlayURL()); |
| 111 | + result.put("wvpLiveBroadcast", wvpConfig.getWvpLiveBroadcast()); | |
| 111 | 112 | |
| 112 | 113 | } catch (Exception e) { |
| 113 | 114 | log.error("查询车辆通道异常:[{}]", carNo, e); | ... | ... |
src/main/java/com/bsth/service/impl/videoimpl/VideoServiceImpl.java
| ... | ... | @@ -280,8 +280,8 @@ public class VideoServiceImpl implements VideoService { |
| 280 | 280 | } |
| 281 | 281 | //超时时间 |
| 282 | 282 | RequestConfig requestConfig = RequestConfig.custom() |
| 283 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | |
| 284 | - .setSocketTimeout(3500).build(); | |
| 283 | + .setConnectTimeout(12500).setConnectionRequestTimeout(12000) | |
| 284 | + .setSocketTimeout(13500).build(); | |
| 285 | 285 | get.setConfig(requestConfig); |
| 286 | 286 | |
| 287 | 287 | response = httpClient.execute(get); | ... | ... |
src/main/java/com/bsth/service/impl/videoimpl/WvpConfig.java
src/main/resources/application-test.properties
| ... | ... | @@ -74,11 +74,13 @@ sso.http.url.auth= https://112.64.45.51/information/authenticate/authorityAuthen |
| 74 | 74 | |
| 75 | 75 | wvp.login.user=admin |
| 76 | 76 | wvo.login.pwd=e9bc0e13a8a16cbb07b175d92a113126 |
| 77 | -wvp.login.url=http://127.0.0.1:18080/api/user/login | |
| 78 | -wvp.channel.list.url=http://127.0.0.1:18080/api/device/query/query/channel/carNo/{carNo} | |
| 79 | -wvp.channel.list.img.url=http://127.0.0.1:18080/api/device/query/snap/ | |
| 80 | -wvp.channel.play.url =http://192.168.169.100:1091/rtp/ | |
| 81 | -wvp.channel.history.list.url=http://127.0.0.1:18080/api/gb_record/query/{device}/{channel}?startTime={startTimeStr}&endTime={endTimeStr} | |
| 77 | +wvp.login.url=http://61.169.120.202:28080/api/user/login | |
| 78 | +wvp.channel.list.url=http://61.169.120.202:28080/api/device/query/query/channel/carNo/{carNo} | |
| 79 | +wvp.channel.list.img.url=http://61.169.120.202:28080/api/device/query/snap/ | |
| 80 | +wvp.channel.play.url =http://61.169.120.202:1091/rtp/ | |
| 81 | +wvp.channel.live.broadcast.url=http://61.169.120.202:28080/#/play/wasm/ws%3A%2F%2F61.169.120.202%3A1091%2Frtp%2F{device}_{channel}.live.flv | |
| 82 | +wvp.channel.history.list.url=http://61.169.120.202:28080/api/gb_record/query/{device}/{channel}?startTime={startTimeStr}&endTime={endTimeStr} | |
| 83 | + | |
| 82 | 84 | |
| 83 | 85 | #客流图像 |
| 84 | 86 | passengerFlow.url = http://58.247.254.118:9999/images/ | ... | ... |
src/main/resources/static/pages/video/video.js
| ... | ... | @@ -161,7 +161,7 @@ function queryChannelByCarNo(treeNode, obj) { |
| 161 | 161 | $.each(rep.data, function (index, node) { |
| 162 | 162 | html += "<tr><td>" + node.channelId + "</td><td>" + node.deviceId + "</td><td>" + node.name + "</td><td>" + getBigSnap(rep.channelImageURL, node.deviceId, node.channelId) + "</td><td>" + node.manufacture; |
| 163 | 163 | html += "</td><td>" + hasAudioText(node.hasAudio) + "</td><td>" + wvpStatusText(node.status) + "</td><td><button class=\"layui-btn layui-btn-primary layui-border\" onclick=\"playWvpVideo('"; |
| 164 | - html += rep.wvpPlayURL + "','" + node.deviceId + "','" + node.channelId + "')\">播放</button><button class=\"layui-btn layui-btn-primary layui-border\" onclick=\"deviceVedioPage('" + node.deviceId + "','" + node.channelId + "')\">设备录像</button></td></tr>"; | |
| 164 | + html += rep.wvpLiveBroadcast + "','" + node.deviceId + "','" + node.channelId + "')\">播放</button><button class=\"layui-btn layui-btn-primary layui-border\" onclick=\"deviceVedioPage('" + node.deviceId + "','" + node.channelId + "')\">设备录像</button></td></tr>"; | |
| 165 | 165 | }); |
| 166 | 166 | } |
| 167 | 167 | |
| ... | ... | @@ -189,51 +189,26 @@ function getBigSnap(imageURL, deviceId, channelId) { |
| 189 | 189 | function playWvpVideo(playURL, deviceId, channelId) { |
| 190 | 190 | var idDiv = "video_" + (Date.now()); |
| 191 | 191 | var html = "'<div id='" + idDiv + "' style='padding-top: 0;'></div>'"; |
| 192 | + playURL = playURL.replace("{device}",deviceId).replace("{channel}",channelId); | |
| 192 | 193 | |
| 193 | - let player = null; | |
| 194 | - var myVar = null; | |
| 195 | - var playURL1 = playURL + deviceId + "_" + channelId + ".live.mp4"; | |
| 196 | 194 | |
| 197 | 195 | var index = layer.open({ |
| 198 | - type: 1, | |
| 196 | + type: 2, | |
| 199 | 197 | title: "视频播放", |
| 200 | 198 | area: ['1000px', '650px'], |
| 201 | 199 | height: '800px', |
| 202 | - content: html, | |
| 200 | + content: playURL, | |
| 203 | 201 | success: function (layero, index, that) { |
| 204 | - player = playVideo(playURL1, idDiv); | |
| 205 | - | |
| 206 | - myVar = setInterval(function () { | |
| 207 | - player = playVideo(playURL1, idDiv); | |
| 208 | - | |
| 209 | - }, 300000); | |
| 210 | - | |
| 211 | - | |
| 212 | - }, | |
| 213 | - beforeEnd: function (layero, index, that) { | |
| 214 | - if (player) { | |
| 215 | - player = null; | |
| 216 | - } | |
| 217 | - | |
| 218 | - if (myVar) { | |
| 219 | - window.clearInterval(myVar); | |
| 220 | - myVar = null; | |
| 221 | - } | |
| 222 | - | |
| 223 | - $("#" + idDiv).html(""); | |
| 224 | 202 | } |
| 225 | 203 | }); |
| 204 | + | |
| 226 | 205 | } |
| 227 | 206 | |
| 228 | -function playVideo(url, ID) { | |
| 207 | +function playVideo(url, ID,time) { | |
| 229 | 208 | return new WebMediaPlayer(url, ID, function () { |
| 230 | 209 | }, { |
| 231 | - cbUserPtr: this, | |
| 232 | - decodeType: 'auto', | |
| 233 | - openAudio: true, | |
| 234 | - autoplay: true, | |
| 235 | - bigPlay: false, | |
| 236 | - showMode: false | |
| 210 | + autoplay: 1, | |
| 211 | + currentTime:time | |
| 237 | 212 | }).play(); |
| 238 | 213 | } |
| 239 | 214 | |
| ... | ... | @@ -307,7 +282,10 @@ function deviceVidemoQueryHistory(device, channel, $deviceVideoDiv, idDiv) { |
| 307 | 282 | if (resp.status === "SUCCESS") { |
| 308 | 283 | var html = "<tr>"; |
| 309 | 284 | $.each(resp.data, function (index, node) { |
| 310 | - html += "<td><button class=\"layui-btn layui-btn-primary layui-border\" onclick=\"playDeviceVidemoQueryHistory('" + idDiv + "','" + resp.wvpPlayURL + "','" + device + "','" + channel + "','" + node.startTime + "','" + node.endTime + "','" + resp.token + "')\">" + node.filePath + "</button></td>"; | |
| 285 | + if(isEmpty(node.filePath)){ | |
| 286 | + node.filePath=node.startTime+"_"+index; | |
| 287 | + } | |
| 288 | + html += "<td><button class=\"layui-btn layui-btn-primary layui-border\" onclick=\"playDeviceVidemoQueryHistory('" + idDiv + "','" + resp.wvpPlayURL + "','" + device + "','" + channel + "','" + node.startTime + "','" + node.endTime + "','" + resp.token + "')\" title='"+ node.filePath+"'>" + node.filePath + "</button></td>"; | |
| 311 | 289 | if (index % 2 === 1) { |
| 312 | 290 | html += "</tr><tr>"; |
| 313 | 291 | } |
| ... | ... | @@ -315,6 +293,8 @@ function deviceVidemoQueryHistory(device, channel, $deviceVideoDiv, idDiv) { |
| 315 | 293 | |
| 316 | 294 | $("#deviceVideoTbody", $deviceVideoDiv).html(html); |
| 317 | 295 | closeLoading(); |
| 296 | + }else{ | |
| 297 | + closeLoading(); | |
| 318 | 298 | } |
| 319 | 299 | }); |
| 320 | 300 | } |
| ... | ... | @@ -330,7 +310,7 @@ function playDeviceVidemoQueryHistory(idDiv, url, device, channel, startTime, en |
| 330 | 310 | console.log(url); |
| 331 | 311 | var idDiv1 = "device_video_play_" + (Date.now()); |
| 332 | 312 | $("#videoPlay", $("#" + idDiv)).html("<div id='" + idDiv1 + "' style='height:550px;width:99%'></div>") |
| 333 | - player = playVideo(url, idDiv1); | |
| 313 | + player = playVideo(url, idDiv1,0); | |
| 334 | 314 | |
| 335 | 315 | } |
| 336 | 316 | |
| ... | ... | @@ -372,7 +352,7 @@ function skeywebPlayerChannel($skeyewebplayer, carNo) { |
| 372 | 352 | if (rep.data) { |
| 373 | 353 | let html = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"1\" class=\"layui-table\"><tbody>"; |
| 374 | 354 | $.each(rep.data, function (index, node) { |
| 375 | - html = html + "<tr><td><button class=\"layui-btn layui-btn-primary\" channelNode='" + node.name + "' deviceId='" + node.deviceId + "' channelId='" + node.channelId + "' onclick=\"skeyewebplayerChannelClick('" + rep.wvpPlayURL + "',this)\">" + node.name + "</button></td></tr>"; | |
| 355 | + html = html + "<tr><td><button class=\"layui-btn layui-btn-primary\" channelNode='" + node.name + "' deviceId='" + node.deviceId + "' channelId='" + node.channelId + "' onclick=\"skeyewebplayerChannelClick('" + rep.wvpLiveBroadcast + "',this)\">" + node.name + "</button></td></tr>"; | |
| 376 | 356 | }); |
| 377 | 357 | $("#skeyewebplayerDivChannel", $skeyewebplayer).html(html); |
| 378 | 358 | closeLoading(); |
| ... | ... | @@ -381,17 +361,16 @@ function skeywebPlayerChannel($skeyewebplayer, carNo) { |
| 381 | 361 | }); |
| 382 | 362 | } |
| 383 | 363 | |
| 384 | -function skeyewebplayerChannelClick(playURL, btn) { | |
| 385 | - console.log(btn); | |
| 364 | +function skeyewebplayerChannelClick(playURL, btn,deviceId,channelId) { | |
| 386 | 365 | let children = $("#skeyewebplayerDivContent", $("#skeyewebplayer")).children(); |
| 387 | 366 | let length = children.length; |
| 388 | 367 | if (length === 1) { |
| 389 | - displaySkeyewebplayerChannel(children[0], playURL, btn); | |
| 368 | + displaySkeyewebplayerChannel(children[0], playURL, btn,deviceId,channelId); | |
| 390 | 369 | } else if (length > 1) { |
| 391 | 370 | for (let i = 0; i < length; i++) { |
| 392 | 371 | let classCss = $(children[i]).attr("class"); |
| 393 | 372 | if (classCss.indexOf("skeyewebplayerDivContent_play_selected") > -1) { |
| 394 | - displaySkeyewebplayerChannel(children[i], playURL, btn); | |
| 373 | + displaySkeyewebplayerChannel(children[i], playURL, btn,deviceId,channelId); | |
| 395 | 374 | break; |
| 396 | 375 | } |
| 397 | 376 | } |
| ... | ... | @@ -400,19 +379,22 @@ function skeyewebplayerChannelClick(playURL, btn) { |
| 400 | 379 | |
| 401 | 380 | } |
| 402 | 381 | |
| 403 | -function displaySkeyewebplayerChannel(htmlNode, playURL, btn) { | |
| 382 | +function displaySkeyewebplayerChannel(htmlNode, playURL, btn,deviceId,channelId) { | |
| 404 | 383 | loading = loadingFunction(); |
| 405 | 384 | let $htmlNode = $(htmlNode); |
| 406 | - | |
| 407 | 385 | let $btn = $(btn); |
| 408 | - $("div[class='skeyewebplayerDiv_title']", $htmlNode).html($btn.attr("channelNode")); | |
| 386 | + deviceId = $btn.attr("deviceId"); | |
| 387 | + channelId = $btn.attr("channelId"); | |
| 409 | 388 | |
| 410 | - let playURL1 = playURL + $btn.attr("deviceId") + "_" + $btn.attr("channelId") + ".live.mp4"; | |
| 411 | - $("div[class='skeyewebplayerDiv_play_content']", $htmlNode).html(""); | |
| 412 | 389 | |
| 413 | - playVideo2(playURL1, $("div[class='skeyewebplayerDiv_play_content']", $htmlNode)); | |
| 390 | + let htmlObj = $("div[class='skeyewebplayerDiv_play_content']", $htmlNode); | |
| 414 | 391 | |
| 392 | + htmlObj.html(""); | |
| 393 | + $("div[class='skeyewebplayerDiv_title']", $htmlNode).html($btn.attr("channelNode")); | |
| 394 | + playURL = playURL.replace("{device}",deviceId).replace("{channel}",channelId); | |
| 395 | + let playURL1 = "<iframe style='width:100%;height:100%;' src ='"+playURL+"'/>"; | |
| 415 | 396 | |
| 397 | + htmlObj.html(playURL1); | |
| 416 | 398 | closeLoading(); |
| 417 | 399 | } |
| 418 | 400 | |
| ... | ... | @@ -449,7 +431,7 @@ function skeyWebPlayer(len, parentId) { |
| 449 | 431 | var html = ""; |
| 450 | 432 | for (let i = 0; i < len; i++) { |
| 451 | 433 | html += "<div class='" + classCss + "' id='skeyewebplayerDivContent_play_" + i + "' onclick=\"skeyewebplayerDivContent_play_click(this)\"><div class='skeyewebplayerDiv_title'>"; |
| 452 | - html += "</div><div id='skeyewebplayerDiv_play_content_" + i + "' class='skeyewebplayerDiv_play_content'></div></div>"; | |
| 434 | + html += "</div><div id='skeyewebplayerDiv_play_content_" + i + "' class='skeyewebplayerDiv_play_content' style='height: 95%'></div></div>"; | |
| 453 | 435 | } |
| 454 | 436 | $skeyewebplayerDivContent.html(html); |
| 455 | 437 | ... | ... |