Monica视频监控处理程序
xc
2021-04-27 cdb957a6df222e8bc2ea8ce22e164d6588ab5255
通过rtsp 实现
通过摄像头ID 实现
over
3 files modified
60 ■■■■ changed files
src/main/java/com/hbbh/adapter/controller/MonibucaController.java 48 ●●●●● patch | view | raw | blame | history
src/main/resources/public/js/history/historyComponent.js 6 ●●●● patch | view | raw | blame | history
src/main/resources/public/js/live/liveComponent.js 6 ●●●● patch | view | raw | blame | history
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) {
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) {
                }
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) {
                }