Commit 77e3e0878f9ffe8881bc8b168cc4173257c707df
1 parent
91ee708c
修复云端录像查看
Showing
7 changed files
with
47 additions
and
27 deletions
pom.xml
| ... | ... | @@ -10,8 +10,8 @@ |
| 10 | 10 | </parent> |
| 11 | 11 | |
| 12 | 12 | <groupId>com.genersoft</groupId> |
| 13 | - <artifactId>wvp-gb28181</artifactId> | |
| 14 | - <version>2.0.0</version> | |
| 13 | + <artifactId>wvp-pro</artifactId> | |
| 14 | + <version>2.0</version> | |
| 15 | 15 | <name>web video platform</name> |
| 16 | 16 | |
| 17 | 17 | <repositories> |
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | |
| 45 | 45 | <properties> |
| 46 | 46 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 47 | - <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format> | |
| 47 | + <maven.build.timestamp.format>MMddHHmm</maven.build.timestamp.format> | |
| 48 | 48 | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> |
| 49 | 49 | |
| 50 | 50 | <!-- 依赖版本 --> | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| ... | ... | @@ -194,7 +194,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 194 | 194 | mediaConfig.setId(zlmServerConfig.getGeneralMediaServerId()); |
| 195 | 195 | mediaConfig.setCreateTime(now); |
| 196 | 196 | mediaConfig.setUpdateTime(now); |
| 197 | - serverItem = mediaConfig; | |
| 197 | + serverItem = mediaConfig.getMediaSerItem(); | |
| 198 | 198 | mediaServerMapper.add(mediaConfig); |
| 199 | 199 | }else { |
| 200 | 200 | // 一个新的zlm接入wvp | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
| ... | ... | @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | 4 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 5 | 5 | import com.genersoft.iot.vmp.service.IMediaService; |
| 6 | 6 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 7 | +import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | |
| 7 | 8 | import io.swagger.annotations.Api; |
| 8 | 9 | import io.swagger.annotations.ApiImplicitParam; |
| 9 | 10 | import io.swagger.annotations.ApiImplicitParams; |
| ... | ... | @@ -47,9 +48,18 @@ public class MediaController { |
| 47 | 48 | }) |
| 48 | 49 | @GetMapping(value = "/stream_info_by_app_and_stream") |
| 49 | 50 | @ResponseBody |
| 50 | - public StreamInfo getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam String mediaServerId){ | |
| 51 | - | |
| 52 | - return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream,mediaServerId); | |
| 51 | + public WVPResult<StreamInfo> getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam String mediaServerId){ | |
| 52 | + StreamInfo streamInfoByAppAndStreamWithCheck = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId); | |
| 53 | + WVPResult<StreamInfo> result = new WVPResult<>(); | |
| 54 | + if (streamInfoByAppAndStreamWithCheck != null){ | |
| 55 | + result.setCode(0); | |
| 56 | + result.setMsg("scccess"); | |
| 57 | + result.setData(streamInfoByAppAndStreamWithCheck); | |
| 58 | + }else { | |
| 59 | + result.setCode(-1); | |
| 60 | + result.setMsg("fail"); | |
| 61 | + } | |
| 62 | + return result; | |
| 53 | 63 | } |
| 54 | 64 | |
| 55 | 65 | ... | ... |
src/main/resources/wvp.sqlite
No preview for this file type
web_src/src/components/CloudRecord.vue
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 | <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;"> |
| 9 | 9 | <span style="font-size: 1rem; font-weight: bold;">云端录像</span> |
| 10 | 10 | <div style="position: absolute; right: 5rem; top: 0.3rem;"> |
| 11 | - 节点选择: <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServer" placeholder="请选择" default-first-option> | |
| 11 | + 节点选择: <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择"> | |
| 12 | 12 | <el-option |
| 13 | 13 | v-for="item in mediaServerList" |
| 14 | 14 | :key="item.id" |
| 15 | - :label="item.id + '( ' + item.streamIp + ' )'" | |
| 16 | - :value="item"> | |
| 15 | + :label="item.id" | |
| 16 | + :value="item.id"> | |
| 17 | 17 | </el-option> |
| 18 | 18 | </el-select> |
| 19 | 19 | </div> |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | :total="total"> |
| 53 | 53 | </el-pagination> |
| 54 | 54 | </div> |
| 55 | - <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServer="mediaServer" ></cloud-record-detail> | |
| 55 | + <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServerId="mediaServerId" ></cloud-record-detail> | |
| 56 | 56 | </el-main> |
| 57 | 57 | </el-container> |
| 58 | 58 | </div> |
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | data() { |
| 71 | 71 | return { |
| 72 | 72 | mediaServerList: [], // 滅体节点列表 |
| 73 | - mediaServer: null, // 媒体服务 | |
| 73 | + mediaServerId: null, // 媒体服务 | |
| 74 | 74 | recordList: [], // 设备列表 |
| 75 | 75 | chooseRecord: null, // 媒体服务 |
| 76 | 76 | |
| ... | ... | @@ -111,9 +111,9 @@ |
| 111 | 111 | getMediaServerList: function (){ |
| 112 | 112 | let that = this; |
| 113 | 113 | that.mediaServerObj.getMediaServerList((data)=>{ |
| 114 | - that.mediaServerList = data; | |
| 114 | + that.mediaServerList = data.data; | |
| 115 | 115 | if (that.mediaServerList.length > 0) { |
| 116 | - that.mediaServer = that.mediaServerList[0] | |
| 116 | + that.mediaServerId = that.mediaServerList[0].id | |
| 117 | 117 | that.getRecordList(); |
| 118 | 118 | } |
| 119 | 119 | }) |
| ... | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 | let that = this; |
| 123 | 123 | this.$axios({ |
| 124 | 124 | method: 'get', |
| 125 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/list`, | |
| 125 | + url:`/record_proxy/${that.mediaServerId}/api/record/list`, | |
| 126 | 126 | params: { |
| 127 | 127 | page: that.currentPage, |
| 128 | 128 | count: that.count |
| ... | ... | @@ -142,7 +142,8 @@ |
| 142 | 142 | }, |
| 143 | 143 | chooseMediaChange(val){ |
| 144 | 144 | console.log(val) |
| 145 | - this.mediaServer = val; | |
| 145 | + this.total = 0; | |
| 146 | + this.recordList = []; | |
| 146 | 147 | this.getRecordList(); |
| 147 | 148 | }, |
| 148 | 149 | showRecordDetail(row){ | ... | ... |
web_src/src/components/CloudRecordDetail.vue
| ... | ... | @@ -110,7 +110,7 @@ |
| 110 | 110 | components: { |
| 111 | 111 | uiHeader, player |
| 112 | 112 | }, |
| 113 | - props: ['recordFile', 'mediaServer', 'dateFiles'], | |
| 113 | + props: ['recordFile', 'mediaServerId', 'dateFiles'], | |
| 114 | 114 | data() { |
| 115 | 115 | return { |
| 116 | 116 | basePath: process.env.NODE_ENV === 'development'?`${location.origin}/debug/zlm`:`${location.origin}/zlm`, |
| ... | ... | @@ -238,7 +238,7 @@ |
| 238 | 238 | let that = this; |
| 239 | 239 | that.$axios({ |
| 240 | 240 | method: 'get', |
| 241 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/file/list`, | |
| 241 | + url:`/record_proxy/${that.mediaServerId}/api/record/file/list`, | |
| 242 | 242 | params: { |
| 243 | 243 | app: that.recordFile.app, |
| 244 | 244 | stream: that.recordFile.stream, |
| ... | ... | @@ -263,7 +263,7 @@ |
| 263 | 263 | this.videoUrl = ""; |
| 264 | 264 | }else { |
| 265 | 265 | // TODO 控制列表滚动条 |
| 266 | - this.videoUrl = `${this.basePath}/${this.mediaServer.recordAppName}/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` | |
| 266 | + this.videoUrl = `${this.basePath}/${this.mediaServerId}/record/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` | |
| 267 | 267 | console.log(this.videoUrl) |
| 268 | 268 | } |
| 269 | 269 | |
| ... | ... | @@ -312,7 +312,7 @@ |
| 312 | 312 | let that = this; |
| 313 | 313 | this.$axios({ |
| 314 | 314 | method: 'delete', |
| 315 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/delete`, | |
| 315 | + url:`/record_proxy/${that.mediaServerId}/api/record/delete`, | |
| 316 | 316 | params: { |
| 317 | 317 | page: that.currentPage, |
| 318 | 318 | count: that.count |
| ... | ... | @@ -331,7 +331,7 @@ |
| 331 | 331 | that.dateFilesObj = {}; |
| 332 | 332 | this.$axios({ |
| 333 | 333 | method: 'get', |
| 334 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/date/list`, | |
| 334 | + url:`/record_proxy/${that.mediaServerId}/api/record/date/list`, | |
| 335 | 335 | params: { |
| 336 | 336 | app: that.recordFile.app, |
| 337 | 337 | stream: that.recordFile.stream |
| ... | ... | @@ -380,7 +380,7 @@ |
| 380 | 380 | let that = this; |
| 381 | 381 | this.$axios({ |
| 382 | 382 | method: 'get', |
| 383 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/file/download/task/add`, | |
| 383 | + url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, | |
| 384 | 384 | params: { |
| 385 | 385 | app: that.recordFile.app, |
| 386 | 386 | stream: that.recordFile.stream, |
| ... | ... | @@ -405,7 +405,7 @@ |
| 405 | 405 | let that = this; |
| 406 | 406 | this.$axios({ |
| 407 | 407 | method: 'get', |
| 408 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/file/download/task/list`, | |
| 408 | + url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, | |
| 409 | 409 | params: { |
| 410 | 410 | isEnd: isEnd, |
| 411 | 411 | } | ... | ... |
web_src/src/components/StreamProxyList.vue
| ... | ... | @@ -211,10 +211,19 @@ |
| 211 | 211 | } |
| 212 | 212 | }).then(function (res) { |
| 213 | 213 | that.getListLoading = false; |
| 214 | - that.$refs.devicePlayer.openDialog("streamPlay", null, null, { | |
| 215 | - streamInfo: res.data, | |
| 216 | - hasAudio: true | |
| 217 | - }); | |
| 214 | + if (res.data.code === 0) { | |
| 215 | + that.$refs.devicePlayer.openDialog("streamPlay", null, null, { | |
| 216 | + streamInfo: res.data.data, | |
| 217 | + hasAudio: true | |
| 218 | + }); | |
| 219 | + }else { | |
| 220 | + that.$message({ | |
| 221 | + showClose: true, | |
| 222 | + message: "获取地址失败:" + res.data.msg, | |
| 223 | + type: "error", | |
| 224 | + }); | |
| 225 | + } | |
| 226 | + | |
| 218 | 227 | }).catch(function (error) { |
| 219 | 228 | console.log(error); |
| 220 | 229 | that.getListLoading = false; | ... | ... |