调整 on_stream_none_reader 仅对 rtmp 做处理

This commit is contained in:
shikong 2024-03-13 10:13:37 +08:00
parent 8fefeb2187
commit ff6a5484e3
2 changed files with 5 additions and 3 deletions

View File

@ -32,14 +32,16 @@ public class ZlmHookApi {
@PostJson("/on_stream_changed")
public void onStreamChanged(@RequestBody ZlmStreamChangeDTO dto){
log.debug("on_stream_changed {}", dto);
if(StringUtils.equalsIgnoreCase(dto.getSchema(), "rtsp")){
if(StringUtils.equalsIgnoreCase(dto.getSchema(), "rtmp")){
zlmStreamChangeHookService.processEvent(dto.getApp(),dto.getStream(), dto.getRegist());
}
}
@PostJson("/on_stream_none_reader")
public void onStreamNoneReader(@RequestBody ZlmStreamNoneReaderDTO dto){
zlmStreamNoneReaderHookService.processEvent(dto.getApp(),dto.getStream());
if(StringUtils.equalsIgnoreCase(dto.getSchema(), "rtmp")){
zlmStreamNoneReaderHookService.processEvent(dto.getApp(),dto.getStream());
}
}
@SneakyThrows

View File

@ -428,7 +428,7 @@ public class DeviceProxyService {
.withStopStrategy(StopStrategies.stopAfterAttempt(3))
.build();
String toUrl = "rtsp://" + zlmMediaConfig.getIp() + ":" + zlmRtmpConfig.getPort() + "/" + ZLM_FFMPEG_PROXY_APP +"/" + callId;
String toUrl = "rtmp://" + zlmMediaConfig.getIp() + ":" + zlmRtmpConfig.getPort() + "/" + ZLM_FFMPEG_PROXY_APP +"/" + callId;
String key = GenericSubscribe.Helper.getKey(Request.BYE, callId);
try {
ZlmResponse<AddFFmpegSourceResp> sourceResp = retryer.call(() -> zlmMediaService.addFfmpegSource(AddFFmpegSource.builder()