From 660d16c69552a4c55f9db8054076d74f87691c20 Mon Sep 17 00:00:00 2001 From: luoshuyue <239937404@qq.com> Date: Fri, 25 Feb 2022 15:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A0=E4=BA=BA=E8=A7=82?= =?UTF-8?q?=E7=9C=8B=E6=97=B6=E5=85=B3=E9=97=ADzlm=E6=8B=89=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMHttpHookListener.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 4f458135..3789207e 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 @@ -83,6 +83,9 @@ public class ZLMHttpHookListener { @Autowired private MediaConfig mediaConfig; + @Autowired + private ZLMRESTfulUtils zlmresTfulUtils; + /** * 服务器定时上报时间,上报间隔可配置,默认10s上报一次 * @@ -465,6 +468,18 @@ public class ZLMHttpHookListener { streamProxyService.del(app, streamId); String url = streamProxyItem.getUrl() != null?streamProxyItem.getUrl():streamProxyItem.getSrc_url(); logger.info("[{}/{}]<-[{}] 拉流代理无人观看已经移除", app, streamId, url); + + }else if (streamProxyItem != null && streamProxyItem.isEnable()) { + MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); + if(null!=mediaServerItem){ + JSONObject jsonObject = zlmresTfulUtils.closeStreams(mediaServerItem,streamProxyItem.getApp(), streamProxyItem.getStream()); + if (jsonObject.getInteger("code") == 0) { + streamProxyItem.setEnable(false); + storager.updateStreamProxy(streamProxyItem); + } + }else { + ret.put("close", false); + } }else { ret.put("close", false); }