From b45d71ba6d7474dc21dfa54df37876429bf2ec46 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 10 四月 2024 22:56:14 +0800
Subject: [PATCH] Merge pull request #1389 from ancienter/develop-add-api-key

---
 src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java b/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java
index 345cc48..907e904 100755
--- a/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java
@@ -1,9 +1,6 @@
 package com.genersoft.iot.vmp.media.event.hook;
 
-import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
-import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent;
-import com.genersoft.iot.vmp.media.event.media.MediaEvent;
-import com.genersoft.iot.vmp.media.event.media.MediaPublishEvent;
+import com.genersoft.iot.vmp.media.event.media.*;
 import org.springframework.context.event.EventListener;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -35,7 +32,7 @@
     @Async("taskExecutor")
     @EventListener
     public void onApplicationEvent(MediaArrivalEvent event) {
-        if ("rtsp".equals(event.getSchema())) {
+        if (event.getSchema() == null || "rtsp".equals(event.getSchema())) {
             sendNotify(HookType.on_media_arrival, event);
         }
 
@@ -47,7 +44,7 @@
     @Async("taskExecutor")
     @EventListener
     public void onApplicationEvent(MediaDepartureEvent event) {
-        if ("rtsp".equals(event.getSchema())) {
+        if (event.getSchema() == null || "rtsp".equals(event.getSchema())) {
             sendNotify(HookType.on_media_departure, event);
         }
 
@@ -60,6 +57,14 @@
     public void onApplicationEvent(MediaPublishEvent event) {
         sendNotify(HookType.on_publish, event);
     }
+    /**
+     * 鎺ㄦ祦閴存潈浜嬩欢
+     */
+    @Async("taskExecutor")
+    @EventListener
+    public void onApplicationEvent(MediaRecordMp4Event event) {
+        sendNotify(HookType.on_record_mp4, event);
+    }
 
     private final Map<String, Event> allSubscribes = new ConcurrentHashMap<>();
     private final Map<String, Hook> allHook = new ConcurrentHashMap<>();

--
Gitblit v1.8.0