chenjialing
2022-06-14 8f7db635a31f2817fa920e4d43bc8718f1bc070d
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专用的鉴权事件,先触发on_rtsp_realm事件然后才会触发on_rtsp_auth事件。