Commit 05960d357318a62ecfe1e9c29beafae2251c72a4
1 parent
9aa9b15b
修复重启zlm导致的点播失败
Showing
1 changed file
with
5 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
| 21 | import org.springframework.beans.factory.annotation.Value; | 21 | import org.springframework.beans.factory.annotation.Value; |
| 22 | import org.springframework.http.HttpStatus; | 22 | import org.springframework.http.HttpStatus; |
| 23 | import org.springframework.http.ResponseEntity; | 23 | import org.springframework.http.ResponseEntity; |
| 24 | +import org.springframework.util.StringUtils; | ||
| 24 | import org.springframework.web.bind.annotation.PostMapping; | 25 | import org.springframework.web.bind.annotation.PostMapping; |
| 25 | import org.springframework.web.bind.annotation.RequestBody; | 26 | import org.springframework.web.bind.annotation.RequestBody; |
| 26 | import org.springframework.web.bind.annotation.RequestMapping; | 27 | import org.springframework.web.bind.annotation.RequestMapping; |
| @@ -68,6 +69,9 @@ public class ZLMHttpHookListener { | @@ -68,6 +69,9 @@ public class ZLMHttpHookListener { | ||
| 68 | @Value("${media.ip}") | 69 | @Value("${media.ip}") |
| 69 | private String mediaIp; | 70 | private String mediaIp; |
| 70 | 71 | ||
| 72 | + @Value("${media.wanIp}") | ||
| 73 | + private String mediaWanIp; | ||
| 74 | + | ||
| 71 | @Value("${media.port}") | 75 | @Value("${media.port}") |
| 72 | private int mediaPort; | 76 | private int mediaPort; |
| 73 | 77 | ||
| @@ -358,6 +362,7 @@ public class ZLMHttpHookListener { | @@ -358,6 +362,7 @@ public class ZLMHttpHookListener { | ||
| 358 | // List<MediaServerConfig> mediaServerConfigs = JSON.parseArray(JSON.toJSONString(json), MediaServerConfig.class); | 362 | // List<MediaServerConfig> mediaServerConfigs = JSON.parseArray(JSON.toJSONString(json), MediaServerConfig.class); |
| 359 | // MediaServerConfig mediaServerConfig = mediaServerConfigs.get(0); | 363 | // MediaServerConfig mediaServerConfig = mediaServerConfigs.get(0); |
| 360 | MediaServerConfig mediaServerConfig = JSON.toJavaObject(json, MediaServerConfig.class); | 364 | MediaServerConfig mediaServerConfig = JSON.toJavaObject(json, MediaServerConfig.class); |
| 365 | + mediaServerConfig.setWanIp(StringUtils.isEmpty(mediaWanIp)? mediaIp: mediaWanIp); | ||
| 361 | mediaServerConfig.setLocalIP(mediaIp); | 366 | mediaServerConfig.setLocalIP(mediaIp); |
| 362 | redisCatchStorage.updateMediaInfo(mediaServerConfig); | 367 | redisCatchStorage.updateMediaInfo(mediaServerConfig); |
| 363 | // TODO Auto-generated method stub | 368 | // TODO Auto-generated method stub |