Browse Source

修复云端录像查看

pull/129/head
64850858 3 years ago
parent
commit
77e3e0878f
  1. 6
      pom.xml
  2. 2
      src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
  3. 16
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
  4. BIN
      src/main/resources/wvp.sqlite
  5. 19
      web_src/src/components/CloudRecord.vue
  6. 14
      web_src/src/components/CloudRecordDetail.vue
  7. 11
      web_src/src/components/StreamProxyList.vue

6
pom.xml

@ -10,8 +10,8 @@
</parent> </parent>
<groupId>com.genersoft</groupId> <groupId>com.genersoft</groupId>
<artifactId>wvp-gb28181</artifactId> <artifactId>wvp-pro</artifactId>
<version>2.0.0</version> <version>2.0</version>
<name>web video platform</name> <name>web video platform</name>
<repositories> <repositories>
@ -44,7 +44,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format> <maven.build.timestamp.format>MMddHHmm</maven.build.timestamp.format>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<!-- 依赖版本 --> <!-- 依赖版本 -->

2
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java

@ -194,7 +194,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
mediaConfig.setId(zlmServerConfig.getGeneralMediaServerId()); mediaConfig.setId(zlmServerConfig.getGeneralMediaServerId());
mediaConfig.setCreateTime(now); mediaConfig.setCreateTime(now);
mediaConfig.setUpdateTime(now); mediaConfig.setUpdateTime(now);
serverItem = mediaConfig; serverItem = mediaConfig.getMediaSerItem();
mediaServerMapper.add(mediaConfig); mediaServerMapper.add(mediaConfig);
}else { }else {
// 一个新的zlm接入wvp // 一个新的zlm接入wvp

16
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java

@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.service.IStreamPushService; import com.genersoft.iot.vmp.service.IStreamPushService;
import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.service.IMediaService;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -47,9 +48,18 @@ public class MediaController {
}) })
@GetMapping(value = "/stream_info_by_app_and_stream") @GetMapping(value = "/stream_info_by_app_and_stream")
@ResponseBody @ResponseBody
public StreamInfo getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam String mediaServerId){ public WVPResult<StreamInfo> getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam String mediaServerId){
StreamInfo streamInfoByAppAndStreamWithCheck = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId);
return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream,mediaServerId); WVPResult<StreamInfo> result = new WVPResult<>();
if (streamInfoByAppAndStreamWithCheck != null){
result.setCode(0);
result.setMsg("scccess");
result.setData(streamInfoByAppAndStreamWithCheck);
}else {
result.setCode(-1);
result.setMsg("fail");
}
return result;
} }

BIN
src/main/resources/wvp.sqlite

Binary file not shown.

19
web_src/src/components/CloudRecord.vue

@ -8,12 +8,12 @@
<div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;"> <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">
<span style="font-size: 1rem; font-weight: bold;">云端录像</span> <span style="font-size: 1rem; font-weight: bold;">云端录像</span>
<div style="position: absolute; right: 5rem; top: 0.3rem;"> <div style="position: absolute; right: 5rem; top: 0.3rem;">
节点选择: <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServer" placeholder="请选择" default-first-option> 节点选择: <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择">
<el-option <el-option
v-for="item in mediaServerList" v-for="item in mediaServerList"
:key="item.id" :key="item.id"
:label="item.id + '( ' + item.streamIp + ' )'" :label="item.id"
:value="item"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -52,7 +52,7 @@
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
<cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServer="mediaServer" ></cloud-record-detail> <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServerId="mediaServerId" ></cloud-record-detail>
</el-main> </el-main>
</el-container> </el-container>
</div> </div>
@ -70,7 +70,7 @@
data() { data() {
return { return {
mediaServerList: [], // mediaServerList: [], //
mediaServer: null, // mediaServerId: null, //
recordList: [], // recordList: [], //
chooseRecord: null, // chooseRecord: null, //
@ -111,9 +111,9 @@
getMediaServerList: function (){ getMediaServerList: function (){
let that = this; let that = this;
that.mediaServerObj.getMediaServerList((data)=>{ that.mediaServerObj.getMediaServerList((data)=>{
that.mediaServerList = data; that.mediaServerList = data.data;
if (that.mediaServerList.length > 0) { if (that.mediaServerList.length > 0) {
that.mediaServer = that.mediaServerList[0] that.mediaServerId = that.mediaServerList[0].id
that.getRecordList(); that.getRecordList();
} }
}) })
@ -122,7 +122,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/list`, url:`/record_proxy/${that.mediaServerId}/api/record/list`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count
@ -142,7 +142,8 @@
}, },
chooseMediaChange(val){ chooseMediaChange(val){
console.log(val) console.log(val)
this.mediaServer = val; this.total = 0;
this.recordList = [];
this.getRecordList(); this.getRecordList();
}, },
showRecordDetail(row){ showRecordDetail(row){

14
web_src/src/components/CloudRecordDetail.vue

@ -110,7 +110,7 @@
components: { components: {
uiHeader, player uiHeader, player
}, },
props: ['recordFile', 'mediaServer', 'dateFiles'], props: ['recordFile', 'mediaServerId', 'dateFiles'],
data() { data() {
return { return {
basePath: process.env.NODE_ENV === 'development'?`${location.origin}/debug/zlm`:`${location.origin}/zlm`, basePath: process.env.NODE_ENV === 'development'?`${location.origin}/debug/zlm`:`${location.origin}/zlm`,
@ -238,7 +238,7 @@
let that = this; let that = this;
that.$axios({ that.$axios({
method: 'get', method: 'get',
url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/file/list`, url:`/record_proxy/${that.mediaServerId}/api/record/file/list`,
params: { params: {
app: that.recordFile.app, app: that.recordFile.app,
stream: that.recordFile.stream, stream: that.recordFile.stream,
@ -263,7 +263,7 @@
this.videoUrl = ""; this.videoUrl = "";
}else { }else {
// TODO // TODO
this.videoUrl = `${this.basePath}/${this.mediaServer.recordAppName}/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` this.videoUrl = `${this.basePath}/${this.mediaServerId}/record/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}`
console.log(this.videoUrl) console.log(this.videoUrl)
} }
@ -312,7 +312,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'delete', method: 'delete',
url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/delete`, url:`/record_proxy/${that.mediaServerId}/api/record/delete`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count
@ -331,7 +331,7 @@
that.dateFilesObj = {}; that.dateFilesObj = {};
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/date/list`, url:`/record_proxy/${that.mediaServerId}/api/record/date/list`,
params: { params: {
app: that.recordFile.app, app: that.recordFile.app,
stream: that.recordFile.stream stream: that.recordFile.stream
@ -380,7 +380,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/file/download/task/add`, url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`,
params: { params: {
app: that.recordFile.app, app: that.recordFile.app,
stream: that.recordFile.stream, stream: that.recordFile.stream,
@ -405,7 +405,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`/record_proxy/${that.mediaServer.generalMediaServerId}/api/record/file/download/task/list`, url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`,
params: { params: {
isEnd: isEnd, isEnd: isEnd,
} }

11
web_src/src/components/StreamProxyList.vue

@ -211,10 +211,19 @@
} }
}).then(function (res) { }).then(function (res) {
that.getListLoading = false; that.getListLoading = false;
if (res.data.code === 0) {
that.$refs.devicePlayer.openDialog("streamPlay", null, null, { that.$refs.devicePlayer.openDialog("streamPlay", null, null, {
streamInfo: res.data, streamInfo: res.data.data,
hasAudio: true hasAudio: true
}); });
}else {
that.$message({
showClose: true,
message: "获取地址失败:" + res.data.msg,
type: "error",
});
}
}).catch(function (error) { }).catch(function (error) {
console.log(error); console.log(error);
that.getListLoading = false; that.getListLoading = false;

Loading…
Cancel
Save