From 8f7db635a31f2817fa920e4d43bc8718f1bc070d Mon Sep 17 00:00:00 2001 From: chenjialing <595168663@qq.com> Date: 星期三, 15 六月 2022 14:13:43 +0800 Subject: [PATCH] 优化----okhttp连接访问超时设置,访问异常code设置为-2 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index 3694fdf..528609d 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -91,10 +91,9 @@ public ResponseEntity<String> onServerKeepalive(@RequestBody JSONObject json){ if (logger.isDebugEnabled()) { - logger.debug("[ ZLM HOOK ]on_server_keepalive API璋冪敤锛屽弬鏁帮細" + json.toString()); + logger.debug("[ ZLM HOOK ] on_server_keepalive API璋冪敤锛屽弬鏁帮細" + json.toString()); } String mediaServerId = json.getString("mediaServerId"); - List<ZLMHttpHookSubscribe.Event> subscribes = this.subscribe.getSubscribes(ZLMHttpHookSubscribe.HookType.on_server_keepalive); if (subscribes != null && subscribes.size() > 0) { for (ZLMHttpHookSubscribe.Event subscribe : subscribes) { @@ -164,7 +163,6 @@ if (mediaInfo != null) { subscribe.response(mediaInfo, json); } - } JSONObject ret = new JSONObject(); ret.put("code", 0); @@ -247,6 +245,23 @@ ret.put("msg", "success"); return new ResponseEntity<String>(ret.toString(),HttpStatus.OK); } + /** + * 褰曞埗hls瀹屾垚鍚庨�氱煡浜嬩欢锛涙浜嬩欢瀵瑰洖澶嶄笉鏁忔劅銆� + * + */ + @ResponseBody + @PostMapping(value = "/on_record_ts", produces = "application/json;charset=UTF-8") + public ResponseEntity<String> onRecordTs(@RequestBody JSONObject json){ + + if (logger.isDebugEnabled()) { + logger.debug("[ ZLM HOOK ]on_record_ts API璋冪敤锛屽弬鏁帮細" + json.toString()); + } + String mediaServerId = json.getString("mediaServerId"); + JSONObject ret = new JSONObject(); + ret.put("code", 0); + ret.put("msg", "success"); + return new ResponseEntity<String>(ret.toString(),HttpStatus.OK); + } /** * rtsp涓撶敤鐨勯壌鏉冧簨浠讹紝鍏堣Е鍙憃n_rtsp_realm浜嬩欢鐒跺悗鎵嶄細瑙﹀彂on_rtsp_auth浜嬩欢銆� -- Gitblit v1.8.0