修复点播与录像回放

pull/1411/head
648540858 2024-03-31 00:34:44 +08:00
parent 4548695a0b
commit 5973dcd975
1 changed files with 5 additions and 2 deletions

View File

@ -173,7 +173,7 @@ public class ZLMHttpHookListener {
String mediaServerId = json.getString("mediaServerId"); String mediaServerId = json.getString("mediaServerId");
MediaServer mediaServer = mediaServerService.getOne(mediaServerId); MediaServer mediaServer = mediaServerService.getOne(mediaServerId);
if (mediaServer == null) { if (mediaServer == null) {
return new HookResultForOnPublish(200, "success"); return new HookResultForOnPublish(0, "success");
} }
ResultForOnPublish resultForOnPublish = mediaService.authenticatePublish(mediaServer, param.getApp(), param.getStream(), param.getParams()); ResultForOnPublish resultForOnPublish = mediaService.authenticatePublish(mediaServer, param.getApp(), param.getStream(), param.getParams());
@ -197,6 +197,9 @@ public class ZLMHttpHookListener {
public HookResult onStreamChanged(@RequestBody OnStreamChangedHookParam param) { public HookResult onStreamChanged(@RequestBody OnStreamChangedHookParam param) {
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId()); MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
if (mediaServer == null) {
return HookResult.SUCCESS();
}
if (param.isRegist()) { if (param.isRegist()) {
logger.info("[ZLM HOOK] 流注册, {}->{}->{}/{}", param.getMediaServerId(), param.getSchema(), param.getApp(), param.getStream()); logger.info("[ZLM HOOK] 流注册, {}->{}->{}/{}", param.getMediaServerId(), param.getSchema(), param.getApp(), param.getStream());
@ -329,9 +332,9 @@ public class ZLMHttpHookListener {
logger.info("[ZLM HOOK] 录像完成事件:{}->{}", param.getMediaServerId(), param.getFile_path()); logger.info("[ZLM HOOK] 录像完成事件:{}->{}", param.getMediaServerId(), param.getFile_path());
try { try {
MediaRecordMp4Event event = new MediaRecordMp4Event(this);
MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId()); MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId());
if (mediaServerItem != null) { if (mediaServerItem != null) {
MediaRecordMp4Event event = MediaRecordMp4Event.getInstance(this, param, mediaServerItem);
event.setMediaServer(mediaServerItem); event.setMediaServer(mediaServerItem);
applicationEventPublisher.publishEvent(event); applicationEventPublisher.publishEvent(event);
} }