From cdb957a6df222e8bc2ea8ce22e164d6588ab5255 Mon Sep 17 00:00:00 2001
From: xc <double72cheng@gmail.com>
Date: Tue, 27 Apr 2021 17:31:36 +0800
Subject: [PATCH] 通过rtsp 实现 通过摄像头ID 实现 over
---
src/main/resources/public/js/live/liveComponent.js | 6 +++---
src/main/resources/public/js/history/historyComponent.js | 6 +++---
src/main/java/com/hbbh/adapter/controller/MonibucaController.java | 48 +++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 51 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/hbbh/adapter/controller/MonibucaController.java b/src/main/java/com/hbbh/adapter/controller/MonibucaController.java
index 20a1502..e8540f0 100644
--- a/src/main/java/com/hbbh/adapter/controller/MonibucaController.java
+++ b/src/main/java/com/hbbh/adapter/controller/MonibucaController.java
@@ -71,9 +71,9 @@
return monicaResult;
}
- @RequestMapping(value = "/history", method = RequestMethod.GET)
- @ApiOperation("history")
- public MonicaResult History(@RequestParam("param")String param,@RequestParam("startTime")String startTime) {
+ @RequestMapping(value = "rtsp/live", method = RequestMethod.GET)
+ @ApiOperation("liveRTSP")
+ public MonicaResult liveRTSP(@RequestParam("param")String param) {
MonicaResult monicaResult = new MonicaResult();
try {
monicaResult.setSourceURL("rtsp:////");
@@ -91,6 +91,48 @@
return monicaResult;
}
+
+ @RequestMapping(value = "/history", method = RequestMethod.GET)
+ @ApiOperation("history")
+ public MonicaResult history(@RequestParam("param")String param,@RequestParam("startTime")String startTime) {
+ MonicaResult monicaResult = new MonicaResult();
+ try {
+ monicaResult.setSourceURL("rtsp:////");
+ monicaResult.setHlsURL("");
+ monicaResult.setFlvURL("");
+ monicaResult.setJessicaURL("ws://172.16.30.113:8082/live/ff80808178af424e0178af44e677000343616d657261.flv");
+ monicaResult.setWebrtcURL("");
+ monicaResult.setStreamPath("live/ff80808178af424e0178af44e677000343616d657261");
+
+ return monicaResult;
+ } catch (Exception e) {
+ log.error("接口:com.hbbh.adapter.controller.api.MonibucaAPIController.parseVideoRTSP 调用失败");
+ e.printStackTrace();
+ }
+ return monicaResult;
+ }
+
+ @RequestMapping(value = "rtsp/history", method = RequestMethod.GET)
+ @ApiOperation("historyRTSP")
+ public MonicaResult historyRTSP(@RequestParam("param")String param,@RequestParam("startTime")String startTime) {
+ MonicaResult monicaResult = new MonicaResult();
+ try {
+ monicaResult.setSourceURL("rtsp:////");
+ monicaResult.setHlsURL("");
+ monicaResult.setFlvURL("");
+ monicaResult.setJessicaURL("ws://172.16.30.113:8082/live/ff80808178af424e0178af44e677000343616d657261.flv");
+ monicaResult.setWebrtcURL("");
+ monicaResult.setStreamPath("live/ff80808178af424e0178af44e677000343616d657261");
+
+ return monicaResult;
+ } catch (Exception e) {
+ log.error("接口:com.hbbh.adapter.controller.api.MonibucaAPIController.parseVideoRTSP 调用失败");
+ e.printStackTrace();
+ }
+ return monicaResult;
+ }
+
+
@RequestMapping(value = "/stop", method = RequestMethod.GET)
@ApiOperation("stop")
public String stop(@RequestParam("param")String param) {
diff --git a/src/main/resources/public/js/history/historyComponent.js b/src/main/resources/public/js/history/historyComponent.js
index 6776c09..1e38fdb 100755
--- a/src/main/resources/public/js/history/historyComponent.js
+++ b/src/main/resources/public/js/history/historyComponent.js
@@ -82,7 +82,7 @@
HistoryComponent.prototype.playVideo = function (video_id,starttime, callback) {
$.ajax({
type: "get",
- url: "../../webapi/media/historical?param=" + video_id+ "&startTime=" + starttime+"&endTime=",
+ url: "../../monica/history?param=" + video_id+ "&startTime=" + starttime+"&endTime=",
timeout: 5000,
async: false,
success: function (result) {
@@ -94,7 +94,7 @@
HistoryComponent.prototype.playVideoRTSP = function (rtspURL,starttime, callback) {
$.ajax({
type: "get",
- url: "../../webapi/media/rtsp/historical?param=" + rtspURL+ "&startTime=" + starttime+"&endTime=",
+ url: "../../monica/rtsp/history?param=" + rtspURL+ "&startTime=" + starttime+"&endTime=",
timeout: 5000,
async: false,
success: function (result) {
@@ -108,7 +108,7 @@
if (streamPath && typeof streamPath === "string") {
$.ajax({
type: "get",
- url: "../../webapi/media/stop?param=" + streamPath,
+ url: "../../monica/stop?param=" + streamPath,
async: false,
success: function (result) {
}
diff --git a/src/main/resources/public/js/live/liveComponent.js b/src/main/resources/public/js/live/liveComponent.js
index 47fb3d3..592c507 100755
--- a/src/main/resources/public/js/live/liveComponent.js
+++ b/src/main/resources/public/js/live/liveComponent.js
@@ -90,7 +90,7 @@
LiveComponent.prototype.playVideo = function (video_id, callback) {
$.ajax({
type: "get",
- url: "../../webapi/media/live?param=" + video_id,
+ url: "../../monica/live?param=" + video_id,
timeout: 5000,
async: false,
success: function (result) {
@@ -102,7 +102,7 @@
LiveComponent.prototype.playVideoRTSP = function (rtspUrl, callback) {
$.ajax({
type: "get",
- url: "../../webapi/media/rtsp/live?param=" + rtspUrl,
+ url: "../../monica/rtsp/live?param=" + rtspUrl,
timeout: 5000,
async: false,
success: function (result) {
@@ -116,7 +116,7 @@
if (streamPath && typeof streamPath === "string") {
$.ajax({
type: "get",
- url: "../../webapi/media/stop?param=" + streamPath,
+ url: "../../monica/stop?param=" + streamPath,
async: false,
success: function (result) {
}
--
Gitblit v1.9.1