Commit d87ff7bf4da6c8725a951dff96425192b5de5129
1 parent
88d5b106
添加回放控制界面,优化录像查询接口
Showing
4 changed files
with
295 additions
and
8 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java
| @@ -56,17 +56,21 @@ public class GBRecordController { | @@ -56,17 +56,21 @@ public class GBRecordController { | ||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | Device device = storager.queryVideoDevice(deviceId); | 58 | Device device = storager.queryVideoDevice(deviceId); |
| 59 | - cmder.recordInfoQuery(device, channelId, startTime, endTime); | ||
| 60 | // 指定超时时间 1分钟30秒 | 59 | // 指定超时时间 1分钟30秒 |
| 61 | DeferredResult<ResponseEntity<RecordInfo>> result = new DeferredResult<>(90*1000L); | 60 | DeferredResult<ResponseEntity<RecordInfo>> result = new DeferredResult<>(90*1000L); |
| 62 | String uuid = UUID.randomUUID().toString(); | 61 | String uuid = UUID.randomUUID().toString(); |
| 63 | String key = DeferredResultHolder.CALLBACK_CMD_RECORDINFO + deviceId + channelId; | 62 | String key = DeferredResultHolder.CALLBACK_CMD_RECORDINFO + deviceId + channelId; |
| 63 | + RequestMessage msg = new RequestMessage(); | ||
| 64 | + msg.setId(uuid); | ||
| 65 | + msg.setKey(key); | ||
| 66 | + cmder.recordInfoQuery(device, channelId, startTime, endTime, (eventResult -> { | ||
| 67 | + msg.setData("查询录像失败, status: " + eventResult.statusCode + ", message: " + eventResult.msg ); | ||
| 68 | + resultHolder.invokeResult(msg); | ||
| 69 | + })); | ||
| 70 | + | ||
| 64 | // 录像查询以channelId作为deviceId查询 | 71 | // 录像查询以channelId作为deviceId查询 |
| 65 | resultHolder.put(key, uuid, result); | 72 | resultHolder.put(key, uuid, result); |
| 66 | result.onTimeout(()->{ | 73 | result.onTimeout(()->{ |
| 67 | - RequestMessage msg = new RequestMessage(); | ||
| 68 | - msg.setId(uuid); | ||
| 69 | - msg.setKey(key); | ||
| 70 | msg.setData("timeout"); | 74 | msg.setData("timeout"); |
| 71 | resultHolder.invokeResult(msg); | 75 | resultHolder.invokeResult(msg); |
| 72 | }); | 76 | }); |
web_src/src/components/dialog/devicePlayer.vue
| @@ -39,7 +39,30 @@ | @@ -39,7 +39,30 @@ | ||
| 39 | </el-tab-pane> | 39 | </el-tab-pane> |
| 40 | <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}--> | 40 | <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}--> |
| 41 | <el-tab-pane label="录像查询" name="record" v-if="showRrecord"> | 41 | <el-tab-pane label="录像查询" name="record" v-if="showRrecord"> |
| 42 | - <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> | 42 | + <div style="float: left"> |
| 43 | + <span>录像控制</span> | ||
| 44 | + <el-button-group style="margin-left: 1rem"> | ||
| 45 | + <el-button size="mini" class="iconfont icon-zanting" title="开始" @click="gbPause()"></el-button> | ||
| 46 | + <el-button size="mini" class="iconfont icon-kaishi" title="暂停" @click="gbPlay()"></el-button> | ||
| 47 | + <el-dropdown size="mini" title="播放倍速" @command="gbScale"> | ||
| 48 | + <el-button size="mini"> | ||
| 49 | + 倍速 <i class="el-icon-arrow-down el-icon--right"></i> | ||
| 50 | + </el-button> | ||
| 51 | + <el-dropdown-menu slot="dropdown"> | ||
| 52 | + <el-dropdown-item command="0.25">0.25倍速</el-dropdown-item> | ||
| 53 | + <el-dropdown-item command="0.5">0.5倍速</el-dropdown-item> | ||
| 54 | + <el-dropdown-item command="1.0">1倍速</el-dropdown-item> | ||
| 55 | + <el-dropdown-item command="2.0">2倍速</el-dropdown-item> | ||
| 56 | + <el-dropdown-item command="4.0">4倍速</el-dropdown-item> | ||
| 57 | + </el-dropdown-menu> | ||
| 58 | + </el-dropdown> | ||
| 59 | + </el-button-group> | ||
| 60 | + </div> | ||
| 61 | + <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> | ||
| 62 | + <div class="block" > | ||
| 63 | + <span class="demonstration" style="padding: 12px 36px 12px 0;float: left;">{{Math.floor(seekTime * sliderTime / 100000)}}秒</span> | ||
| 64 | + <el-slider style="width: 80%; float:left;" v-model="sliderTime" @change="gbSeek" :show-tooltip="false"></el-slider> | ||
| 65 | + </div> | ||
| 43 | <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> | 66 | <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> |
| 44 | <el-table-column label="名称" prop="name"></el-table-column> | 67 | <el-table-column label="名称" prop="name"></el-table-column> |
| 45 | <el-table-column label="文件" prop="filePath"></el-table-column> | 68 | <el-table-column label="文件" prop="filePath"></el-table-column> |
| @@ -210,6 +233,8 @@ export default { | @@ -210,6 +233,8 @@ export default { | ||
| 210 | showPtz: true, | 233 | showPtz: true, |
| 211 | showRrecord: true, | 234 | showRrecord: true, |
| 212 | tracksNotLoaded: false, | 235 | tracksNotLoaded: false, |
| 236 | + sliderTime: 0, | ||
| 237 | + seekTime: 0, | ||
| 213 | }; | 238 | }; |
| 214 | }, | 239 | }, |
| 215 | methods: { | 240 | methods: { |
| @@ -433,6 +458,11 @@ export default { | @@ -433,6 +458,11 @@ export default { | ||
| 433 | }, | 458 | }, |
| 434 | playRecord: function (row) { | 459 | playRecord: function (row) { |
| 435 | let that = this; | 460 | let that = this; |
| 461 | + | ||
| 462 | + let startTime = row.startTime | ||
| 463 | + let endtime = row.endTime | ||
| 464 | + this.seekTime = new Date(endtime).getTime() - new Date(startTime).getTime(); | ||
| 465 | + console.log(this.seekTime) | ||
| 436 | if (that.streamId != "") { | 466 | if (that.streamId != "") { |
| 437 | that.stopPlayRecord(function () { | 467 | that.stopPlayRecord(function () { |
| 438 | that.streamId = "", | 468 | that.streamId = "", |
| @@ -580,7 +610,40 @@ export default { | @@ -580,7 +610,40 @@ export default { | ||
| 580 | } | 610 | } |
| 581 | console.log(resultArray) | 611 | console.log(resultArray) |
| 582 | return resultArray; | 612 | return resultArray; |
| 613 | + }, | ||
| 614 | + gbPlay(){ | ||
| 615 | + console.log('前端控制:播放'); | ||
| 616 | + this.$axios({ | ||
| 617 | + method: 'get', | ||
| 618 | + url: '/api/playback/resume/' + this.streamId | ||
| 619 | + }).then((res)=> { | ||
| 620 | + this.$refs.videoPlayer.play(this.videoUrl) | ||
| 621 | + }); | ||
| 622 | + }, | ||
| 623 | + gbPause(){ | ||
| 624 | + console.log('前端控制:暂停'); | ||
| 625 | + this.$axios({ | ||
| 626 | + method: 'get', | ||
| 627 | + url: '/api/playback/pause/' + this.streamId | ||
| 628 | + }).then(function (res) {}); | ||
| 629 | + }, | ||
| 630 | + gbScale(command){ | ||
| 631 | + console.log('前端控制:倍速 ' + command); | ||
| 632 | + this.$axios({ | ||
| 633 | + method: 'get', | ||
| 634 | + url: `/api/playback/speed/${this.streamId }/${command}` | ||
| 635 | + }).then(function (res) {}); | ||
| 636 | + }, | ||
| 637 | + gbSeek(val){ | ||
| 638 | + console.log('前端控制:seek '); | ||
| 639 | + console.log(this.seekTime); | ||
| 640 | + console.log(this.sliderTime); | ||
| 641 | + this.$axios({ | ||
| 642 | + method: 'get', | ||
| 643 | + url: `/api/playback/seek/${this.streamId }/` + Math.floor(this.seekTime * val / 100000) | ||
| 644 | + }).then(function (res) {}); | ||
| 583 | } | 645 | } |
| 646 | + | ||
| 584 | } | 647 | } |
| 585 | }; | 648 | }; |
| 586 | </script> | 649 | </script> |
web_src/static/css/iconfont.css
| 1 | @font-face { | 1 | @font-face { |
| 2 | font-family: "iconfont"; /* Project id 1291092 */ | 2 | font-family: "iconfont"; /* Project id 1291092 */ |
| 3 | - src: url('iconfont.woff2?t=1631767887536') format('woff2'), | ||
| 4 | - url('iconfont.woff?t=1631767887536') format('woff'), | ||
| 5 | - url('iconfont.ttf?t=1631767887536') format('truetype'); | 3 | + src: url('iconfont.woff2?t=1637741914969') format('woff2'), |
| 4 | + url('iconfont.woff?t=1637741914969') format('woff'), | ||
| 5 | + url('iconfont.ttf?t=1637741914969') format('truetype'); | ||
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | .iconfont { | 8 | .iconfont { |
| @@ -13,6 +13,226 @@ | @@ -13,6 +13,226 @@ | ||
| 13 | -moz-osx-font-smoothing: grayscale; | 13 | -moz-osx-font-smoothing: grayscale; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | +.icon-suoxiao:before { | ||
| 17 | + content: "\e79a"; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +.icon-shanchu3:before { | ||
| 21 | + content: "\e79b"; | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +.icon-chehui:before { | ||
| 25 | + content: "\e79c"; | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +.icon-wenben:before { | ||
| 29 | + content: "\e79d"; | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +.icon-zhongzuo:before { | ||
| 33 | + content: "\e79e"; | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +.icon-jianqie:before { | ||
| 37 | + content: "\e79f"; | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +.icon-fangda:before { | ||
| 41 | + content: "\e7a0"; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +.icon-fangdazhanshi:before { | ||
| 45 | + content: "\e7a1"; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +.icon-qianjin:before { | ||
| 49 | + content: "\e7a2"; | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +.icon-kuaijin:before { | ||
| 53 | + content: "\e7a3"; | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +.icon-diyigeshipin:before { | ||
| 57 | + content: "\e7a4"; | ||
| 58 | +} | ||
| 59 | + | ||
| 60 | +.icon-kuaitui:before { | ||
| 61 | + content: "\e7a5"; | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +.icon-kaishi:before { | ||
| 65 | + content: "\e7a7"; | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +.icon-zuihouyigeshipin:before { | ||
| 69 | + content: "\e7a8"; | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +.icon-zanting:before { | ||
| 73 | + content: "\e7a9"; | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +.icon-zhankai:before { | ||
| 77 | + content: "\e7aa"; | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +.icon-bendisucai:before { | ||
| 81 | + content: "\e7ab"; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.icon-luzhi:before { | ||
| 85 | + content: "\e7ac"; | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +.icon-ossziyuan:before { | ||
| 89 | + content: "\e7ad"; | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +.icon-chuangjianzhinengfenxirenwu:before { | ||
| 93 | + content: "\e7ae"; | ||
| 94 | +} | ||
| 95 | + | ||
| 96 | +.icon-sousuo3:before { | ||
| 97 | + content: "\e7af"; | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +.icon-gengduo:before { | ||
| 101 | + content: "\e7b0"; | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +.icon-tianjia:before { | ||
| 105 | + content: "\e7b1"; | ||
| 106 | +} | ||
| 107 | + | ||
| 108 | +.icon-xiazai:before { | ||
| 109 | + content: "\e7b2"; | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +.icon-biaojibeifen:before { | ||
| 113 | + content: "\e7b3"; | ||
| 114 | +} | ||
| 115 | + | ||
| 116 | +.icon-bendisucaibeifen:before { | ||
| 117 | + content: "\e7b4"; | ||
| 118 | +} | ||
| 119 | + | ||
| 120 | +.icon-luzhibeifen:before { | ||
| 121 | + content: "\e7b5"; | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +.icon-ossziyuanbeifen:before { | ||
| 125 | + content: "\e7b6"; | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +.icon-bianji3:before { | ||
| 129 | + content: "\e7b7"; | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +.icon-cuti:before { | ||
| 133 | + content: "\e7b8"; | ||
| 134 | +} | ||
| 135 | + | ||
| 136 | +.icon-xieti:before { | ||
| 137 | + content: "\e7b9"; | ||
| 138 | +} | ||
| 139 | + | ||
| 140 | +.icon-xiahuaxian:before { | ||
| 141 | + content: "\e7ba"; | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | +.icon-wuxiaoguo:before { | ||
| 145 | + content: "\e7bb"; | ||
| 146 | +} | ||
| 147 | + | ||
| 148 | +.icon-sousuo4:before { | ||
| 149 | + content: "\e7bc"; | ||
| 150 | +} | ||
| 151 | + | ||
| 152 | +.icon-gouwuche:before { | ||
| 153 | + content: "\e7bd"; | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | +.icon-shuaxin2:before { | ||
| 157 | + content: "\e7be"; | ||
| 158 | +} | ||
| 159 | + | ||
| 160 | +.icon-xiaoxi:before { | ||
| 161 | + content: "\e7bf"; | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | +.icon-wushouquan:before { | ||
| 165 | + content: "\e7c0"; | ||
| 166 | +} | ||
| 167 | + | ||
| 168 | +.icon-tishi2:before { | ||
| 169 | + content: "\e7c1"; | ||
| 170 | +} | ||
| 171 | + | ||
| 172 | +.icon-tishi1:before { | ||
| 173 | + content: "\e7c2"; | ||
| 174 | +} | ||
| 175 | + | ||
| 176 | +.icon-shouquanchenggong:before { | ||
| 177 | + content: "\e7c3"; | ||
| 178 | +} | ||
| 179 | + | ||
| 180 | +.icon-sousuo5:before { | ||
| 181 | + content: "\e7c4"; | ||
| 182 | +} | ||
| 183 | + | ||
| 184 | +.icon-shuaxin3:before { | ||
| 185 | + content: "\e7c5"; | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +.icon-xiazai1:before { | ||
| 189 | + content: "\e7c6"; | ||
| 190 | +} | ||
| 191 | + | ||
| 192 | +.icon-shangchuan:before { | ||
| 193 | + content: "\e7c7"; | ||
| 194 | +} | ||
| 195 | + | ||
| 196 | +.icon-guanbi:before { | ||
| 197 | + content: "\e7c8"; | ||
| 198 | +} | ||
| 199 | + | ||
| 200 | +.icon-wangye-loading:before { | ||
| 201 | + content: "\e7c9"; | ||
| 202 | +} | ||
| 203 | + | ||
| 204 | +.icon-bianzubeifen3:before { | ||
| 205 | + content: "\e7ca"; | ||
| 206 | +} | ||
| 207 | + | ||
| 208 | +.icon-xingzhuangbeifen:before { | ||
| 209 | + content: "\e7cb"; | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | +.icon-bianzubeifen:before { | ||
| 213 | + content: "\e7cc"; | ||
| 214 | +} | ||
| 215 | + | ||
| 216 | +.icon-zhuanchang:before { | ||
| 217 | + content: "\e7cd"; | ||
| 218 | +} | ||
| 219 | + | ||
| 220 | +.icon-meizi:before { | ||
| 221 | + content: "\e7ce"; | ||
| 222 | +} | ||
| 223 | + | ||
| 224 | +.icon-daimabeifen:before { | ||
| 225 | + content: "\e7cf"; | ||
| 226 | +} | ||
| 227 | + | ||
| 228 | +.icon-suoxiao1:before { | ||
| 229 | + content: "\e7d0"; | ||
| 230 | +} | ||
| 231 | + | ||
| 232 | +.icon-ai19:before { | ||
| 233 | + content: "\e799"; | ||
| 234 | +} | ||
| 235 | + | ||
| 16 | .icon-online:before { | 236 | .icon-online:before { |
| 17 | content: "\e600"; | 237 | content: "\e600"; |
| 18 | } | 238 | } |
web_src/static/css/iconfont.woff2
No preview for this file type