1078-支持快照的展示
This commit is contained in:
@@ -193,6 +193,18 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
|||||||
}
|
}
|
||||||
subscribe.removeSubscribe(hook);
|
subscribe.removeSubscribe(hook);
|
||||||
redisTemplate.opsForValue().set(playKey, info);
|
redisTemplate.opsForValue().set(playKey, info);
|
||||||
|
// 截图
|
||||||
|
String streamUrl;
|
||||||
|
if (mediaServer.getRtspPort() != 0) {
|
||||||
|
streamUrl = String.format("rtsp://127.0.0.1:%s/%s/%s", mediaServer.getRtspPort(), "rtp", stream);
|
||||||
|
} else {
|
||||||
|
streamUrl = String.format("http://127.0.0.1:%s/%s/%s.live.mp4", mediaServer.getHttpPort(), "rtp", stream);
|
||||||
|
}
|
||||||
|
String path = "snap";
|
||||||
|
String fileName = phoneNumber + "_" + channelId + ".jpg";
|
||||||
|
// 请求截图
|
||||||
|
logger.info("[请求截图]: " + fileName);
|
||||||
|
mediaServerService.getSnap(mediaServer, streamUrl, 15, 1, path, fileName);
|
||||||
});
|
});
|
||||||
// 开启收流端口
|
// 开启收流端口
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServer, stream, "000", false, false, 0, false, !channel.getHasAudio(), false, 1);
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServer, stream, "000", false, false, 0, false, !channel.getHasAudio(), false, 1);
|
||||||
|
|||||||
@@ -195,12 +195,10 @@ export default {
|
|||||||
|
|
||||||
//通知设备上传媒体流
|
//通知设备上传媒体流
|
||||||
sendDevicePush: function (itemData) {
|
sendDevicePush: function (itemData) {
|
||||||
let deviceId = this.deviceId;
|
|
||||||
this.isLoging = true;
|
this.isLoging = true;
|
||||||
let channelId = itemData.channelId;
|
let channelId = itemData.channelId;
|
||||||
console.log("通知设备推流1:" + deviceId + " : " + channelId);
|
console.log("通知设备推流1:" + this.device.phoneNumber + " : " + channelId);
|
||||||
console.log(this.device);
|
console.log(this.device);
|
||||||
let that = this;
|
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/api/jt1078/live/start',
|
url: '/api/jt1078/live/start',
|
||||||
@@ -209,32 +207,32 @@ export default {
|
|||||||
channelId: channelId,
|
channelId: channelId,
|
||||||
type: 0,
|
type: 0,
|
||||||
}
|
}
|
||||||
}).then(function (res) {
|
}).then((res)=> {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
that.isLoging = false;
|
this.isLoging = false;
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
let snapId = deviceId + "_" + channelId;
|
let snapId = this.device.phoneNumber + "_" + channelId;
|
||||||
that.loadSnap[deviceId + channelId] = 0;
|
this.loadSnap[this.device.phoneNumber + channelId] = 0;
|
||||||
that.getSnapErrorEvent(snapId)
|
this.getSnapErrorEvent(snapId)
|
||||||
}, 5000)
|
}, 5000)
|
||||||
itemData.streamId = res.data.data.stream;
|
itemData.streamId = res.data.data.stream;
|
||||||
that.$refs.devicePlayer.openDialog("media", deviceId, channelId, {
|
this.$refs.devicePlayer.openDialog("media", this.device.phoneNumber, channelId, {
|
||||||
streamInfo: res.data.data,
|
streamInfo: res.data.data,
|
||||||
hasAudio: itemData.hasAudio
|
hasAudio: itemData.hasAudio
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.initData();
|
this.initData();
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
that.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
}).catch(function (e) {
|
}).catch(function (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
that.isLoging = false;
|
this.isLoging = false;
|
||||||
// that.$message.error("请求超时");
|
// that.$message.error("请求超时");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -278,7 +276,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getSnap: function (row) {
|
getSnap: function (row) {
|
||||||
let baseUrl = window.baseUrl ? window.baseUrl : "";
|
let baseUrl = window.baseUrl ? window.baseUrl : "";
|
||||||
return ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + '/api/device/query/snap/' + row.deviceId + '/' + row.channelId;
|
return ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + '/api/device/query/snap/' + this.device.phoneNumber + '/' + row.channelId;
|
||||||
},
|
},
|
||||||
getBigSnap: function (row) {
|
getBigSnap: function (row) {
|
||||||
return [this.getSnap(row)]
|
return [this.getSnap(row)]
|
||||||
@@ -331,43 +329,6 @@ export default {
|
|||||||
console.log(JSON.stringify(res));
|
console.log(JSON.stringify(res));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
subStreamChange: function () {
|
|
||||||
this.$confirm('确定重置所有通道的码流类型?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: `/api/device/query/channel/stream/identification/update/`,
|
|
||||||
params: {
|
|
||||||
deviceId: this.deviceId,
|
|
||||||
streamIdentification: this.subStream
|
|
||||||
}
|
|
||||||
}).then((res)=> {
|
|
||||||
console.log(JSON.stringify(res));
|
|
||||||
this.initData()
|
|
||||||
}).finally(()=>{
|
|
||||||
this.subStream = ""
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
this.subStream = ""
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
channelSubStreamChange: function (row) {
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: `/api/device/query/channel/stream/identification/update/`,
|
|
||||||
params: {
|
|
||||||
deviceId: this.deviceId,
|
|
||||||
channelId: row.channelId,
|
|
||||||
streamIdentification: row.streamIdentification
|
|
||||||
}
|
|
||||||
}).then(function (res) {
|
|
||||||
console.log(JSON.stringify(res));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
refresh: function () {
|
refresh: function () {
|
||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user