File was renamed from src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMStatusEventListener.java |
| | |
| | | package com.genersoft.iot.vmp.media.zlm.event; |
| | | package com.genersoft.iot.vmp.media.event.mediaServer; |
| | | |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | |
| | | * @date: 2020年5月6日 下午1:51:23 |
| | | */ |
| | | @Component |
| | | public class ZLMStatusEventListener { |
| | | public class MediaServerStatusEventListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ZLMStatusEventListener.class); |
| | | private final static Logger logger = LoggerFactory.getLogger(MediaServerStatusEventListener.class); |
| | | |
| | | @Autowired |
| | | private IStreamPushService streamPushService; |
| | |
| | | private IStreamProxyService streamProxyService; |
| | | |
| | | @Autowired |
| | | private IMediaServerService mediaServerService; |
| | | |
| | | @Autowired |
| | | private IPlayService playService; |
| | | |
| | | @Async("taskExecutor") |
| | | @EventListener |
| | | public void onApplicationEvent(ZLMOnlineEvent event) { |
| | | logger.info("[ZLM] 上线 ID:" + event.getMediaServerId()); |
| | | public void onApplicationEvent(MediaServerOnlineEvent event) { |
| | | logger.info("[媒体节点] 上线 ID:" + event.getMediaServerId()); |
| | | streamPushService.zlmServerOnline(event.getMediaServerId()); |
| | | streamProxyService.zlmServerOnline(event.getMediaServerId()); |
| | | playService.zlmServerOnline(event.getMediaServerId()); |
| | |
| | | |
| | | @Async("taskExecutor") |
| | | @EventListener |
| | | public void onApplicationEvent(ZLMOfflineEvent event) { |
| | | public void onApplicationEvent(MediaServerOfflineEvent event) { |
| | | |
| | | logger.info("[ZLM] 离线,ID:" + event.getMediaServerId()); |
| | | logger.info("[媒体节点] 离线,ID:" + event.getMediaServerId()); |
| | | // 处理ZLM离线 |
| | | mediaServerService.zlmServerOffline(event.getMediaServerId()); |
| | | streamProxyService.zlmServerOffline(event.getMediaServerId()); |
| | | streamPushService.zlmServerOffline(event.getMediaServerId()); |
| | | playService.zlmServerOffline(event.getMediaServerId()); |