Commit 77e3e0878f9ffe8881bc8b168cc4173257c707df
1 parent
91ee708c
修复云端录像查看
Showing
7 changed files
with
47 additions
and
27 deletions
pom.xml
| @@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
| 10 | </parent> | 10 | </parent> |
| 11 | 11 | ||
| 12 | <groupId>com.genersoft</groupId> | 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 | <name>web video platform</name> | 15 | <name>web video platform</name> |
| 16 | 16 | ||
| 17 | <repositories> | 17 | <repositories> |
| @@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
| 44 | 44 | ||
| 45 | <properties> | 45 | <properties> |
| 46 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 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 | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> | 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,7 +194,7 @@ public class MediaServerServiceImpl implements IMediaServerService { | ||
| 194 | mediaConfig.setId(zlmServerConfig.getGeneralMediaServerId()); | 194 | mediaConfig.setId(zlmServerConfig.getGeneralMediaServerId()); |
| 195 | mediaConfig.setCreateTime(now); | 195 | mediaConfig.setCreateTime(now); |
| 196 | mediaConfig.setUpdateTime(now); | 196 | mediaConfig.setUpdateTime(now); |
| 197 | - serverItem = mediaConfig; | 197 | + serverItem = mediaConfig.getMediaSerItem(); |
| 198 | mediaServerMapper.add(mediaConfig); | 198 | mediaServerMapper.add(mediaConfig); |
| 199 | }else { | 199 | }else { |
| 200 | // 一个新的zlm接入wvp | 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,6 +4,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 4 | import com.genersoft.iot.vmp.service.IStreamPushService; | 4 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 5 | import com.genersoft.iot.vmp.service.IMediaService; | 5 | import com.genersoft.iot.vmp.service.IMediaService; |
| 6 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 6 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 7 | +import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | ||
| 7 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 8 | import io.swagger.annotations.ApiImplicitParam; | 9 | import io.swagger.annotations.ApiImplicitParam; |
| 9 | import io.swagger.annotations.ApiImplicitParams; | 10 | import io.swagger.annotations.ApiImplicitParams; |
| @@ -47,9 +48,18 @@ public class MediaController { | @@ -47,9 +48,18 @@ public class MediaController { | ||
| 47 | }) | 48 | }) |
| 48 | @GetMapping(value = "/stream_info_by_app_and_stream") | 49 | @GetMapping(value = "/stream_info_by_app_and_stream") |
| 49 | @ResponseBody | 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,12 +8,12 @@ | ||
| 8 | <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;"> | 8 | <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;"> |
| 9 | <span style="font-size: 1rem; font-weight: bold;">云端录像</span> | 9 | <span style="font-size: 1rem; font-weight: bold;">云端录像</span> |
| 10 | <div style="position: absolute; right: 5rem; top: 0.3rem;"> | 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 | <el-option | 12 | <el-option |
| 13 | v-for="item in mediaServerList" | 13 | v-for="item in mediaServerList" |
| 14 | :key="item.id" | 14 | :key="item.id" |
| 15 | - :label="item.id + '( ' + item.streamIp + ' )'" | ||
| 16 | - :value="item"> | 15 | + :label="item.id" |
| 16 | + :value="item.id"> | ||
| 17 | </el-option> | 17 | </el-option> |
| 18 | </el-select> | 18 | </el-select> |
| 19 | </div> | 19 | </div> |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | :total="total"> | 52 | :total="total"> |
| 53 | </el-pagination> | 53 | </el-pagination> |
| 54 | </div> | 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 | </el-main> | 56 | </el-main> |
| 57 | </el-container> | 57 | </el-container> |
| 58 | </div> | 58 | </div> |
| @@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
| 70 | data() { | 70 | data() { |
| 71 | return { | 71 | return { |
| 72 | mediaServerList: [], // 滅体节点列表 | 72 | mediaServerList: [], // 滅体节点列表 |
| 73 | - mediaServer: null, // 媒体服务 | 73 | + mediaServerId: null, // 媒体服务 |
| 74 | recordList: [], // 设备列表 | 74 | recordList: [], // 设备列表 |
| 75 | chooseRecord: null, // 媒体服务 | 75 | chooseRecord: null, // 媒体服务 |
| 76 | 76 | ||
| @@ -111,9 +111,9 @@ | @@ -111,9 +111,9 @@ | ||
| 111 | getMediaServerList: function (){ | 111 | getMediaServerList: function (){ |
| 112 | let that = this; | 112 | let that = this; |
| 113 | that.mediaServerObj.getMediaServerList((data)=>{ | 113 | that.mediaServerObj.getMediaServerList((data)=>{ |
| 114 | - that.mediaServerList = data; | 114 | + that.mediaServerList = data.data; |
| 115 | if (that.mediaServerList.length > 0) { | 115 | if (that.mediaServerList.length > 0) { |
| 116 | - that.mediaServer = that.mediaServerList[0] | 116 | + that.mediaServerId = that.mediaServerList[0].id |
| 117 | that.getRecordList(); | 117 | that.getRecordList(); |
| 118 | } | 118 | } |
| 119 | }) | 119 | }) |
| @@ -122,7 +122,7 @@ | @@ -122,7 +122,7 @@ | ||
| 122 | let that = this; | 122 | let that = this; |
| 123 | this.$axios({ | 123 | this.$axios({ |
| 124 | method: 'get', | 124 | method: 'get', |
| 125 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/list`, | 125 | + url:`/record_proxy/${that.mediaServerId}/api/record/list`, |
| 126 | params: { | 126 | params: { |
| 127 | page: that.currentPage, | 127 | page: that.currentPage, |
| 128 | count: that.count | 128 | count: that.count |
| @@ -142,7 +142,8 @@ | @@ -142,7 +142,8 @@ | ||
| 142 | }, | 142 | }, |
| 143 | chooseMediaChange(val){ | 143 | chooseMediaChange(val){ |
| 144 | console.log(val) | 144 | console.log(val) |
| 145 | - this.mediaServer = val; | 145 | + this.total = 0; |
| 146 | + this.recordList = []; | ||
| 146 | this.getRecordList(); | 147 | this.getRecordList(); |
| 147 | }, | 148 | }, |
| 148 | showRecordDetail(row){ | 149 | showRecordDetail(row){ |
web_src/src/components/CloudRecordDetail.vue
| @@ -110,7 +110,7 @@ | @@ -110,7 +110,7 @@ | ||
| 110 | components: { | 110 | components: { |
| 111 | uiHeader, player | 111 | uiHeader, player |
| 112 | }, | 112 | }, |
| 113 | - props: ['recordFile', 'mediaServer', 'dateFiles'], | 113 | + props: ['recordFile', 'mediaServerId', 'dateFiles'], |
| 114 | data() { | 114 | data() { |
| 115 | return { | 115 | return { |
| 116 | basePath: process.env.NODE_ENV === 'development'?`${location.origin}/debug/zlm`:`${location.origin}/zlm`, | 116 | basePath: process.env.NODE_ENV === 'development'?`${location.origin}/debug/zlm`:`${location.origin}/zlm`, |
| @@ -238,7 +238,7 @@ | @@ -238,7 +238,7 @@ | ||
| 238 | let that = this; | 238 | let that = this; |
| 239 | that.$axios({ | 239 | that.$axios({ |
| 240 | method: 'get', | 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 | params: { | 242 | params: { |
| 243 | app: that.recordFile.app, | 243 | app: that.recordFile.app, |
| 244 | stream: that.recordFile.stream, | 244 | stream: that.recordFile.stream, |
| @@ -263,7 +263,7 @@ | @@ -263,7 +263,7 @@ | ||
| 263 | this.videoUrl = ""; | 263 | this.videoUrl = ""; |
| 264 | }else { | 264 | }else { |
| 265 | // TODO 控制列表滚动条 | 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 | console.log(this.videoUrl) | 267 | console.log(this.videoUrl) |
| 268 | } | 268 | } |
| 269 | 269 | ||
| @@ -312,7 +312,7 @@ | @@ -312,7 +312,7 @@ | ||
| 312 | let that = this; | 312 | let that = this; |
| 313 | this.$axios({ | 313 | this.$axios({ |
| 314 | method: 'delete', | 314 | method: 'delete', |
| 315 | - url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/delete`, | 315 | + url:`/record_proxy/${that.mediaServerId}/api/record/delete`, |
| 316 | params: { | 316 | params: { |
| 317 | page: that.currentPage, | 317 | page: that.currentPage, |
| 318 | count: that.count | 318 | count: that.count |
| @@ -331,7 +331,7 @@ | @@ -331,7 +331,7 @@ | ||
| 331 | that.dateFilesObj = {}; | 331 | that.dateFilesObj = {}; |
| 332 | this.$axios({ | 332 | this.$axios({ |
| 333 | method: 'get', | 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 | params: { | 335 | params: { |
| 336 | app: that.recordFile.app, | 336 | app: that.recordFile.app, |
| 337 | stream: that.recordFile.stream | 337 | stream: that.recordFile.stream |
| @@ -380,7 +380,7 @@ | @@ -380,7 +380,7 @@ | ||
| 380 | let that = this; | 380 | let that = this; |
| 381 | this.$axios({ | 381 | this.$axios({ |
| 382 | method: 'get', | 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 | params: { | 384 | params: { |
| 385 | app: that.recordFile.app, | 385 | app: that.recordFile.app, |
| 386 | stream: that.recordFile.stream, | 386 | stream: that.recordFile.stream, |
| @@ -405,7 +405,7 @@ | @@ -405,7 +405,7 @@ | ||
| 405 | let that = this; | 405 | let that = this; |
| 406 | this.$axios({ | 406 | this.$axios({ |
| 407 | method: 'get', | 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 | params: { | 409 | params: { |
| 410 | isEnd: isEnd, | 410 | isEnd: isEnd, |
| 411 | } | 411 | } |
web_src/src/components/StreamProxyList.vue
| @@ -211,10 +211,19 @@ | @@ -211,10 +211,19 @@ | ||
| 211 | } | 211 | } |
| 212 | }).then(function (res) { | 212 | }).then(function (res) { |
| 213 | that.getListLoading = false; | 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 | }).catch(function (error) { | 227 | }).catch(function (error) { |
| 219 | console.log(error); | 228 | console.log(error); |
| 220 | that.getListLoading = false; | 229 | that.getListLoading = false; |